HStringTemplate: StringTemplate implementation in Haskell.

[ bsd3, library, text ] [ Propose Tags ]

A port of the Java library by Terrence Parr.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
small-baseEnabled
syb-with-classEnabled
simple-genericsEnabled

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

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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.5.1.1, 0.5.1.2, 0.5.1.3, 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, 0.8.8
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-11-11T09:38:53Z
Distributions Arch:0.8.8, Debian:0.8.7, Fedora:0.8.8, FreeBSD:0.8.3, LTSHaskell:0.8.8, NixOS:0.8.8, Stackage:0.8.8
Reverse Dependencies 22 direct, 102 indirect [details]
Downloads 53926 total (74 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for HStringTemplate-0.4.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