-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple string substitution -- -- Simple string substitution library that supports "$"-based -- substitution. Meant to be used when Text.Printf or string -- concatenation would lead to code that is hard to read but when a full -- blown templating system is overkill. @package template @version 0.2.0.4 -- | A simple string substitution library that supports "$"-based -- substitution. Substitution uses the following rules: -- --
-- substitute tmpl ctx == render (template tmpl) ctx --substitute :: Text -> Context -> Text -- | Shows the template string. showTemplate :: Template -> Text -- | Like render, but allows the lookup to have side effects. The -- lookups are performed in order that they are needed to generate the -- resulting text. -- -- You can use this e.g. to report errors when a lookup cannot be made -- successfully. For example, given a list ctx of key-value -- pairs and a Template tmpl: -- --
-- renderA tmpl (flip lookup ctx) ---- -- will return Nothing if any of the placeholders in the -- template don't appear in ctx and Just text -- otherwise. renderA :: Applicative f => Template -> ContextA f -> f Text -- | Performs the template substitution in the given Applicative, -- returning a new Text. Note that -- --
-- substituteA tmpl ctx == renderA (template tmpl) ctx --substituteA :: Applicative f => Text -> ContextA f -> f Text instance Show Frag instance Show Template instance Eq Template