HStringTemplate: StringTemplate implementation in Haskell.

[ bsd3, library, text ] [ Propose Tags ]

A port of the Java library by Terrence Parr.

[Skip to Readme]
Versions [faq] 0.2, 0.3, 0.3.1, 0.3.2, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.5, 0.5.1,,,, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.6.8, 0.6.9, 0.6.10, 0.6.11, 0.6.12, 0.7.0, 0.7.1, 0.7.3, 0.8, 0.8.1, 0.8.2, 0.8.3, 0.8.5, 0.8.6, 0.8.7
Dependencies array, base, bytestring, containers, directory, filepath, old-locale, old-time, parsec, pretty, syb-with-class, time [details]
License BSD-3-Clause
Author Sterling Clover
Maintainer s.clover@gmail.com
Category Text
Uploaded by SterlingClover at 2008-02-02T02:46:08Z
Distributions Debian:0.8.7, Fedora:0.8.7, FreeBSD:0.8.3, LTSHaskell:0.8.7, NixOS:0.8.7, Stackage:0.8.7
Downloads 47423 total (101 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]





Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for HStringTemplate-0.2

[back to package description]
Module      :  Text.StringTemplate.Base
Copyright   :  (c) Sterling Clover 2008
License     :  BSD 3 Clause
Maintainer  :  s.clover@gmail.com
Stability   :  experimental
Portability :  portable

A StringTemplate is a String with "holes" in it. This is a port of the Java StringTemplate library written by Terrence Parr. (<http://www.stringtemplate.org>).

This library implements the basic 3.1 grammar, lacking group files (though not groups themselves), Regions, and Interfaces. The goal is not to blindly copy the StringTemplate API, but rather to take its central ideas and implement them in a Haskellish manner. Indentation and wrapping, for example, are implemented through the HughesPJ Pretty Printing library. Calling toPPDoc on a StringTemplate yields a Doc with appropriate paragraph-fill wrapping that can be rendered in the usual fashion.

This library extends the current StringTemplate grammar by allowing the application of alternating attributes to anonymous as well as regular templates, including therefore sets of alternating attributes.

Basic instances are provided of the StringTemplateShows and ToSElem class. Any type deriving ToSElem can be passed automatically as a StringTemplate attribute. This package can be installed with syb-with-class bindings that provide a ToSElem instance for anything deriving 'Data.Generics.SYB.WithClass.Basics.Data'. When defining an instance of ToSElem that can take a format parameter, you should first define an instance of StringTemplateShows, and then define an instance of ToSElem where @ toSElem = stShowsToSE@.

Along with the haddocks, additional documentation and commentary is at http://fmapfixreturn.wordpress.com