Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/singpolyma/mustache2hs
An attempt to compile Mustache templates to Haskell code
https://github.com/singpolyma/mustache2hs
Last synced: 3 months ago
JSON representation
An attempt to compile Mustache templates to Haskell code
- Host: GitHub
- URL: https://github.com/singpolyma/mustache2hs
- Owner: singpolyma
- License: isc
- Created: 2012-08-18T20:47:51.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-18T01:09:23.000Z (almost 11 years ago)
- Last Synced: 2024-10-07T15:17:17.919Z (3 months ago)
- Language: Haskell
- Size: 227 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: COPYING
Awesome Lists containing this project
README
This utility takes in Haskell records (single data constructor only)
and a list of mustache template and record name pairs, and generates
Haskell code for functions that take an escape function and one of
the records, and returns a 'Data.Text.Lazy.Builder.Builder'.This allows most records to be used as context for rendering a
template, and gives GHC the ability to typecheck the template's use of
record fields at compile time. It also means your application does
not need to be reading template files off disk in production.Usage example:
> mustache2hs -m Records.hs main.mustache SomeRec sub.mustache OtherRec
A full example is in the git repository.