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
A HOAS representation of (possibly partially applied) values in the environment.
Classes
Quote Bool Source # | |
Quote Double Source # | |
Quote Int Source # | |
Quote Integer Source # | |
Quote Builder Source # | |
Quote Scientific Source # | |
Quote Text Source # | |
Quote Object Source # | |
Quote Array Source # | |
Quote Value Source # | |
Quote Text Source # | |
Quote Term Source # | |
Quote [Text] Source # | |
Quote [Value] Source # | |
(Unquote a, Quote b) => Quote (a -> b) Source # | |
Restricted quoters
qpoly2 :: Quote a => Id -> (Value -> Value -> a) -> (Id, Term) Source #
Quote a binary function which takes the most general binding value.
qnum1 :: Id -> (Scientific -> Scientific) -> (Id, Term) Source #
Quote an unary numeric function.
qnum2 :: Quote a => Id -> (Scientific -> Scientific -> a) -> (Id, Term) Source #
Quote a binary numeric function.
qcol1 :: (Quote a, Quote b, Quote c) => Id -> (Text -> a) -> (Object -> b) -> (Array -> c) -> (Id, Term) Source #
Quote a comprehensive set of unary functions to create a binding that supports all collection types.