Copyright | (c) Justus Sagemüller 2017 |
---|---|
License | GPL v3 |
Maintainer | (@) jsagemue $ uni-koeln.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
- data SymbolD σ c
- data Infix s = Infix {
- symbolFixity :: !Fixity
- infixSymbox :: !s
- data Encapsulation s = Encapsulation {
- needInnerParens, haveOuterparens :: !Bool
- leftEncaps, rightEncaps :: !s
- type AlgebraExpr σ l = CAS (Infix l) (Encapsulation l) (SymbolD σ l)
- type AlgebraExpr' γ σ l = CAS' γ (Infix l) (Encapsulation l) (SymbolD σ l)
- type AlgebraPattern σ l = AlgebraExpr' GapId σ l
- don'tParenthesise :: Monoid s¹ => CAS' γ (Infix s²) (Encapsulation s¹) s⁰ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰
- symbolInfix :: s² -> CAS' γ s² s¹ s⁰ -> CAS' γ s² s¹ s⁰ -> CAS' γ s² s¹ s⁰
- symbolFunction :: Monoid s¹ => s¹ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰
- class ASCIISymbols c where
- type RenderingCombinator σ c r = Bool -> Maybe r -> SymbolD σ c -> Maybe r -> r
- data ContextFixity
- expressionFixity :: AlgebraExpr σ c -> Maybe Fixity
- renderSymbolExpression :: forall σ c r. (SymbolClass σ, SCConstraint σ c) => ContextFixity -> RenderingCombinator σ c r -> AlgebraExpr σ c -> r
- showsPrecASCIISymbol :: (ASCIISymbols c, SymbolClass σ, SCConstraint σ c) => Int -> AlgebraExpr σ c -> ShowS
- class UnicodeSymbols c where
- showsPrecUnicodeSymbol :: (UnicodeSymbols c, SymbolClass σ, SCConstraint σ c) => Int -> AlgebraExpr σ c -> ShowS
- class SymbolClass σ where
- type SCConstraint σ :: * -> Constraint
- normaliseSymbols :: forall σ c γ s² s¹. (SymbolClass σ, SCConstraint σ c) => CAS' γ s² s¹ (SymbolD σ c) -> CAS' γ s² s¹ (SymbolD σ c)
- (%$>) :: forall σ c c' γ s² s¹. (SymbolClass σ, SCConstraint σ c) => (c -> c') -> CAS' γ s² s¹ (SymbolD σ c) -> CAS' γ s² s¹ (SymbolD σ c')
- continueExpr :: (Eq l, Monoid l) => (AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l) -> (AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l) -> AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l
- (&~~!) :: (Eq l, Eq (Encapsulation l), SymbolClass σ, SCConstraint σ l, Show (AlgebraExpr σ l), Show (AlgebraPattern σ l)) => AlgebraExpr σ l -> [AlgebraPattern σ l] -> AlgebraExpr σ l
- (&~~:) :: (Eq l, Eq (Encapsulation l), SymbolClass σ, SCConstraint σ l, Show (AlgebraExpr σ l), Show (AlgebraPattern σ l)) => AlgebraExpr σ l -> [AlgebraPattern σ l] -> AlgebraExpr σ l
Documentation
UnicodeSymbols c => Show (Pattern c) # | |
UnicodeSymbols c => Show (Expression c) # | |
(SymbolClass σ, SCConstraint σ c, Eq c) => Eq (SymbolD σ c) Source # | |
(SymbolClass σ, SCConstraint σ String) => Floating (AlgebraExpr' γ σ String) Source # | |
(SymbolClass σ, SCConstraint σ String) => Fractional (AlgebraExpr' γ σ String) Source # | |
(SymbolClass σ, SCConstraint σ String) => Num (AlgebraExpr' γ σ String) Source # | |
ASCIISymbols c => Show (CAS (Infix c) (Encapsulation c) (Symbol c)) # | |
(ASCIISymbols c, Monoid c) => Show (CAS' GapId (Infix c) (Encapsulation c) (Symbol c)) # | |
Infix | |
|
Eq s => Eq (Infix s) Source # | |
UnicodeSymbols c => Show (Pattern c) # | |
UnicodeSymbols c => Show (Expression c) # | |
(SymbolClass σ, SCConstraint σ String) => Floating (AlgebraExpr' γ σ String) Source # | |
(SymbolClass σ, SCConstraint σ String) => Fractional (AlgebraExpr' γ σ String) Source # | |
(SymbolClass σ, SCConstraint σ String) => Num (AlgebraExpr' γ σ String) Source # | |
ASCIISymbols c => Show (CAS (Infix c) (Encapsulation c) (Symbol c)) # | |
(ASCIISymbols c, Monoid c) => Show (CAS' GapId (Infix c) (Encapsulation c) (Symbol c)) # | |
data Encapsulation s Source #
Encapsulation | |
|
Eq (Encapsulation String) Source # | |
UnicodeSymbols c => Show (Pattern c) # | |
UnicodeSymbols c => Show (Expression c) # | |
(SymbolClass σ, SCConstraint σ String) => Floating (AlgebraExpr' γ σ String) Source # | |
(SymbolClass σ, SCConstraint σ String) => Fractional (AlgebraExpr' γ σ String) Source # | |
(SymbolClass σ, SCConstraint σ String) => Num (AlgebraExpr' γ σ String) Source # | |
ASCIISymbols c => Show (CAS (Infix c) (Encapsulation c) (Symbol c)) # | |
(ASCIISymbols c, Monoid c) => Show (CAS' GapId (Infix c) (Encapsulation c) (Symbol c)) # | |
type AlgebraExpr σ l = CAS (Infix l) (Encapsulation l) (SymbolD σ l) Source #
type AlgebraExpr' γ σ l = CAS' γ (Infix l) (Encapsulation l) (SymbolD σ l) Source #
type AlgebraPattern σ l = AlgebraExpr' GapId σ l Source #
don'tParenthesise :: Monoid s¹ => CAS' γ (Infix s²) (Encapsulation s¹) s⁰ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰ Source #
symbolFunction :: Monoid s¹ => s¹ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰ -> CAS' γ (Infix s²) (Encapsulation s¹) s⁰ Source #
class ASCIISymbols c where Source #
fromASCIISymbol :: Char -> c Source #
toASCIISymbols :: c -> String Source #
type RenderingCombinator σ c r Source #
expressionFixity :: AlgebraExpr σ c -> Maybe Fixity Source #
renderSymbolExpression :: forall σ c r. (SymbolClass σ, SCConstraint σ c) => ContextFixity -> RenderingCombinator σ c r -> AlgebraExpr σ c -> r Source #
showsPrecASCIISymbol :: (ASCIISymbols c, SymbolClass σ, SCConstraint σ c) => Int -> AlgebraExpr σ c -> ShowS Source #
class UnicodeSymbols c where Source #
fromUnicodeSymbol :: Char -> c Source #
toUnicodeSymbols :: c -> String Source #
showsPrecUnicodeSymbol :: (UnicodeSymbols c, SymbolClass σ, SCConstraint σ c) => Int -> AlgebraExpr σ c -> ShowS Source #
class SymbolClass σ where Source #
type SCConstraint σ :: * -> Constraint Source #
fromCharSymbol :: (Functor p, SCConstraint σ c) => p σ -> Char -> c Source #
normaliseSymbols :: forall σ c γ s² s¹. (SymbolClass σ, SCConstraint σ c) => CAS' γ s² s¹ (SymbolD σ c) -> CAS' γ s² s¹ (SymbolD σ c) Source #
(%$>) :: forall σ c c' γ s² s¹. (SymbolClass σ, SCConstraint σ c) => (c -> c') -> CAS' γ s² s¹ (SymbolD σ c) -> CAS' γ s² s¹ (SymbolD σ c') infixl 4 Source #
Transform the symbols of an expression, in their underlying representation.
(map succ%$> 𝑎+𝑝) * 𝑥 ≡ (𝑏+𝑞) * 𝑥
:: (Eq l, Monoid l) | |
=> (AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l) | Combinator to use for chaining the new expression to the old ones |
-> (AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l) | Transformation to apply to the rightmost expression in the previous chain |
-> AlgebraExpr' γ σ l -> AlgebraExpr' γ σ l | Transformation which appends the result. |
(&~~!) :: (Eq l, Eq (Encapsulation l), SymbolClass σ, SCConstraint σ l, Show (AlgebraExpr σ l), Show (AlgebraPattern σ l)) => AlgebraExpr σ l -> [AlgebraPattern σ l] -> AlgebraExpr σ l infixl 1 Source #
Apply a sequence of pattern-transformations and yield the result concatenated to the original via the corresponding chain-operator. Because only the rightmost expression in a chain is processed, this can be iterated, giving a chain of intermediate results.
If one of the patterns does not match, this manipulator will raise an error.
(&~~:) :: (Eq l, Eq (Encapsulation l), SymbolClass σ, SCConstraint σ l, Show (AlgebraExpr σ l), Show (AlgebraPattern σ l)) => AlgebraExpr σ l -> [AlgebraPattern σ l] -> AlgebraExpr σ l infixl 1 Source #
Apply a sequence of pattern-transformations, each in every spot possible, and yield the result concatenated to the original via the corresponding chain-operator. Because only the rightmost expression in a chain is processed, this can be iterated, giving a chain of intermediate results.