Copyright | (c) Justus Adam 2017. All Rights Reserved. |
---|---|
License | BSD3 |
Maintainer | dev@justus.science |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
format :: Text -> SubMap -> Either String (Text, [Name]) Source #
Compile a string to a format string and substitute the identifiers from the provided function into it.
Fails if the string canno be parsed. Retuns the rendered string and a list of names which were used in the string but could not be resolved by the function.
format' :: Text -> SubMap -> Text Source #
Compile a string to a format string and substitute the identifiers from the provided function into it.
All errors are ignored. Parse failure is thrown as an error and the missing names are discarded.
formatC :: Compiled -> SubMap -> (Text, [Name]) Source #
Like format
but with the string already compiled
A precompiled format string. Can be used to render several times.