The templater package

[ Tags: library, mit, text ] [ Propose Tags ]

Simple string templater

[Skip to Readme]


Dependencies attoparsec (>=0.12), base (>=4.5 && <5.9), text (>=1.1) [details]
License MIT
Copyright Copyright (C) 2015 Geraud Boyer
Author Geraud Boyer
Maintainer Geraud Boyer <>
Category Text
Home page
Bug tracker
Source repository head: git clone git://
Uploaded Thu Apr 30 15:10:49 UTC 2015 by geraud
Distributions NixOS:
Downloads 511 total (139 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-04-30 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for templater-

[back to package description]


Build Status

Simple string templater


cabal update
cabal install templater


{-# LANGUAGE OverloadedStrings #-}
import           Data.Text
import qualified Data.Text.IO   as TIO
import           Text.Templater

main :: IO ()
main = do
  let textTemplate = "Hello, %{what is it ?}!"
      res = template textTemplate context
  case res of
    Left error -> do
        putStrLn $ "Got Error:" ++ error
    Right result -> TIO.putStrLn result

context :: Context -- Context is a type alias for Text -> Maybe Text
context "what is it ?" = Just "world"
context _ = Nothing

renders to Hello, world!

Well that's all there is to it!...