Safe Haskell | None |
---|---|
Language | Haskell2010 |
The means to construct your own filters.
- data Term
- class Quote a where
- class Unquote a where
- (@:) :: Quote a => Id -> a -> (Id, Term)
- qapply :: Delta -> Term -> Term -> Result Term
- qpoly2 :: Quote a => Id -> (Value -> Value -> a) -> (Id, Term)
- qnum1 :: Id -> (Scientific -> Scientific) -> (Id, Term)
- qnum2 :: Quote a => Id -> (Scientific -> Scientific -> a) -> (Id, Term)
- qcol1 :: (Quote a, Quote b, Quote c) => Id -> (Text -> a) -> (Object -> b) -> (Array -> c) -> (Id, Term)
- typeErr :: Id -> Int -> Doc -> Doc -> Result a
- argumentErr :: Pretty a => Id -> Int -> a -> Result b
Prelude
The default filters available to a template are documented by the subsequent categories.
These filters cannot be overriden and attempting to supply your own filters to
renderWith
will cause the similarly named filters to disappear when
they are merged with the prelude during evaluation. (See: union
)
Boolean
Equality
Relational
Numeric
Fractional
Textual
takeWord
:: Text -> Text
dropWord
:: Text -> Text
lowerHead
:: Text -> Text
upperHead
:: Text -> Text
toTitle
:: Text -> Text
toCamel
:: Text -> Text
toPascal
:: Text -> Text
toSnake
:: Text -> Text
toSpinal
:: Text -> Text
toTrain
:: Text -> Text
toLower
:: Text -> Text
toUpper
:: Text -> Text
toOrdinal
:: Scientific -> Text
Collection
Polymorphic
show
:: a -> Text
Constructing filters
data Term
A HOAS representation of (possibly partially applied) values in the environment.
Classes
class Quote a where
Nothing
class Unquote a where
Nothing
Restricted quoters
qpoly2 :: Quote a => Id -> (Value -> Value -> a) -> (Id, Term)
Quote a binary function which takes the most general binding value.
qnum2 :: Quote a => Id -> (Scientific -> Scientific -> a) -> (Id, Term)
Quote a binary numeric function.
qcol1 :: (Quote a, Quote b, Quote c) => Id -> (Text -> a) -> (Object -> b) -> (Array -> c) -> (Id, Term)
Quote a comprehensive set of unary functions to create a binding that supports all collection types.
Errors
argumentErr :: Pretty a => Id -> Int -> a -> Result b