fillit: Flexible string substitution

[ bsd3, library, text ] [ Propose Tags ]

Please see

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS]
Dependencies base (>=4.7 && <5), data-default, parsec, text, unordered-containers [details]
License BSD-3-Clause
Copyright (c) 2017 ishiy
Author ishiy <>
Maintainer ishiy <>
Category Text
Home page
Uploaded by ishiy at 2017-09-06T21:17:12Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 831 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-09-06 [all 1 reports]

Readme for fillit-

[back to package description]


Flexible String Substitution library


  • Support two kinds of substitutions: required and optional.
  • You can change the symbols for substitutions.

Note: This library does not support any sanitization.



ghci> :set -XOverloadedStrings
ghci> import Data.Text.Fillit
ghci> import qualified Data.HashMap.Lazy as HM
ghci> let dic = HM.fromList [("name", "Tom"), ("age", "22")]
ghci> fill "$name$ (%age%)" dic
Right "Tom (22)"
ghci> fill "$name$ (%school%)" dic
Right "Tom (%school%)"
ghci> fill "$name$ ($school$)" dic
Left "There is no key in dict, such as school"

By default, the symbol $ means a required substitution. On the other hand, the symbol % means a optional substitution. These symbols can be changed. See fill'.


$ git clone
$ cd fillit
$ stack build
$ stack test