ANN: HStringTemplate 0.2

HStringTemplate is a general purpose templating system, geared especially towards HTML and based on Terrence Parr’s Java library.

On Hackage at:

Development version at: darcs get

Haddocks at:

Additional documentation on the grammar at: as well as in some posts at

Lots of cleanup, lots of additions, hopefully this is an extremely usable release. Still no group or interface files, but I suspect that those are mainly useful for code-generation, which seems like something Haskell programmers would want to use something other than a templating system for in any case.

On to the good stuff:

  • Now on hackage!
  • Generics. Not one but two types. One set of simple bindings for the standard Data class, and one for syb-with-class. (Alex Drummond’s RJson library, which is really cool, was very helpful in figuring out how to do this).
  • A withContext method that turns any set of name-value bindings into the context for a StringTemplate. Along with the syb-with-class bindings, this should make for relatively seamless interoperability with HAppS.
  • Lots of other additional bindings for working with standard time formats, numeric types, etc.
  • Encoders. A standard mechanism for HTML-escaping strings (or javascript-escaping, or urlencoding them, or etc.) that A) ensures it happens uniformly and B) ensures it happens no more than once.
  • Improved pretty printing support, eliminating corner-cases where wrapping did not occur.
  • Creation of directory groups is now done properly in the IO monad, with caching functionality moved to the scarily-named unsafeVolatileDirectoryGroup.
  • 80% Top-Level testing coverage in the base. (And more to come, but I only have so much time).

And of course, patches and feedback always welcome.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: