| Copyright | © 2016–2017 Stack Buliders |
|---|---|
| License | BSD 3 clause |
| Maintainer | Mark Karpov <markkarpov92@gmail.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Text.Mustache.Type
Description
Types used in the package. You don't usually need to import the module, because Text.Mustache re-exports everything you may need, import that module instead.
- data Template = Template {
- templateActual :: PName
- templateCache :: Map PName [Node]
- data Node
- newtype Key = Key {}
- showKey :: Key -> Text
- newtype PName = PName {}
- data MustacheException = MustacheParserException Text (ParseError Char Void)
Documentation
Mustache template as name of “top-level” template and a collection of all available templates (partials).
Template is a Semigroup. This means that you can combine Templates
(and their caches) using the ( operator, the resulting <>)Template
will have the same currently selected template as the left one. Union of
caches is also left-biased.
Constructors
| Template | |
Fields
| |
Structural element of template.
Identifier for values to interpolate.
The representation is the following:
[]—empty list means implicit iterators;[text]—single key is a normal identifier;[text1, text2]—multiple keys represent dotted names.
showKey :: Key -> Text Source #
Pretty-print a key, this is helpful, for example, if you want to display an error message.
Since: 0.2.0
Identifier for partials. Note that with the OverloadedStrings
extension you can use just string literals to create values of this type.
data MustacheException Source #
Exception that is thrown when parsing of a template fails or referenced values are not provided.
Constructors
| MustacheParserException Text (ParseError Char Void) | Template parser has failed. This contains the parse error. Before version 0.2.0 it was called The |