-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A tiny text templating library
--   
--   A tiny text templating library
@package tinytemplate
@version 0.1.2.0


-- | Templates can be created in code using the <a>lit</a> and
--   <a>placeholder</a> functions with the <a>Monoid</a> instance, or by
--   parsing a template string:
--   
--   <pre>
--   import Data.Monoid ((&lt;&gt;))
--   
--   t1 = placeholder "lastName" &lt;&gt; lit ", " &lt;&gt; placeholder "firstName"
--   t2 = parseTemplate "{{lastName}}, {{firstName}}"
--   </pre>
--   
--   Templates can be applied using the <a>applyTemplate</a> function:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings
--   
--   &gt;&gt;&gt; let vals = [("firstName", "Haskell"), ("lastName", "Curry")]
--   
--   &gt;&gt;&gt; applyTemplate (`lookup` vals) t1
--   Just "Curry, Haskell"
--   </pre>
module Data.Text.Template

-- | A text template
data Template

-- | Create a <a>Template</a> from a literal string
lit :: Text -> Template

-- | Create a <a>Template</a> from a placeholder which will be replaced
--   during rendering
placeholder :: Text -> Template

-- | Parse a <a>Template</a> from a template string.
--   
--   Placeholders are represented using double-curly-braces (<tt>{{ ...
--   }}</tt>) and everything else is considered literal text.
parseTemplate :: Text -> Template

-- | Traverse a <a>Template</a>, replacing placeholders using the specified
--   function.
applyTemplate :: forall f. (Applicative f) => (Text -> f Text) -> Template -> f Text

-- | Render a <a>Template</a> as a template string.
printTemplate :: Template -> Text
instance GHC.Classes.Ord Data.Text.Template.Template
instance GHC.Classes.Eq Data.Text.Template.Template
instance GHC.Show.Show Data.Text.Template.Template
instance GHC.Classes.Ord Data.Text.Template.TemplatePart
instance GHC.Classes.Eq Data.Text.Template.TemplatePart
instance GHC.Show.Show Data.Text.Template.TemplatePart
instance GHC.Base.Monoid Data.Text.Template.Template
instance GHC.Base.Functor Data.Text.Template.Id
instance GHC.Base.Applicative Data.Text.Template.Id
