Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- render :: Repr -> Inflection -> Exp -> Maybe Text
- data Repr = Repr {
- reprUnknown :: Maybe Text
- reprValue :: Inflection -> Integer -> Maybe (Ctx Exp -> Text)
- reprNeg :: Maybe (Exp -> Ctx Exp -> Text)
- reprAdd :: Maybe (Exp -> Exp -> Ctx Exp -> Text)
- reprMul :: Maybe (Exp -> Exp -> Ctx Exp -> Text)
- reprSub :: Maybe (Exp -> Exp -> Ctx Exp -> Text)
- reprFrac :: Maybe (Exp -> Exp -> Ctx Exp -> Text)
- reprScale :: ScaleRepr
- reprNegCombine :: Maybe (Text -> Text -> Exp -> Text)
- reprAddCombine :: Maybe (Text -> Text -> Exp -> Text -> Exp -> Text)
- reprMulCombine :: Maybe (Text -> Text -> Exp -> Text -> Exp -> Text)
- reprSubCombine :: Maybe (Text -> Text -> Exp -> Text -> Exp -> Text)
- reprFracCombine :: Maybe (Text -> Text -> Exp -> Text -> Exp -> Text)
- type ScaleRepr = Inflection -> Integer -> Integer -> Exp -> Ctx Exp -> Maybe Text
- defaultRepr :: Repr
- data Ctx a
- posIndex :: Ctx a -> Integer
- isOutside :: Side -> Ctx a -> Bool
Rendering numerals
:: Repr | Representation. |
-> Inflection | Initial inflection. |
-> Exp | The expression to render. |
-> Maybe Text |
Renders an expression to a Text
value according to a certain
representation and inflection.
Representation of numerals
A representation for numerals.
A Repr
contains all the information on how to render an
Exp
ression to a Text
value.
Repr | |
|
Function that renders the representation of a step in a scale of large values. The value represented by the step is 10 ^ (rank * base + offset).
defaultRepr :: Repr Source #
Context of expressions
A context in which an Exp
ression appears.