- render :: Monoid s => Repr s -> Exp -> Maybe s
- data Repr s = Repr {
- reprUnknown :: Maybe s
- reprValue :: ℤ -> Maybe (Ctx Exp -> s)
- reprScale :: ℤ -> ℤ -> Exp -> Ctx Exp -> Maybe s
- reprNeg :: Maybe (Exp -> Ctx Exp -> s)
- reprAdd :: Maybe (Exp -> Exp -> Ctx Exp -> s)
- reprMul :: Maybe (Exp -> Exp -> Ctx Exp -> s)
- reprSub :: Maybe (Exp -> Exp -> Ctx Exp -> s)
- reprNegCombine :: Maybe (s -> s -> s)
- reprAddCombine :: Maybe (s -> s -> s -> s)
- reprMulCombine :: Maybe (s -> s -> s -> s)
- reprSubCombine :: Maybe (s -> s -> s -> s)
- defaultRepr :: Monoid s => Repr s
- data Ctx α
Rendering numerals
render :: Monoid s => Repr s -> Exp -> Maybe sSource
Renders an expression to a string-like value according to a certain representation.
Representation of numerals
A representation for numerals.
A Repr
contains all the information on how to render an
Exp
ression to a string-like value.
Repr | |
|
defaultRepr :: Monoid s => Repr sSource