ihs

Interpolated Haskell


Keywords
program, public-domain, Propose Tags
License
Other
Install
cabal install ihs-0.1.0.3

Documentation

ihs: Interpolated Haskell

Hackage Build Status

This abomination allows you to quickly generate text files in a style similar to ERB from Ruby or PHP. But you stay typesafe!

{{
let bottles 0 = "no more bottles"
    bottles 1 = "1 bottle"
    bottles i = show i ++ " bottles"
-}}
{{for_ [99,98..0] $ \i ->}}
{{-if i == 0 then-}}
No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
{{-else-}}
{{=bottles i}} of beer on the wall, {{=bottles i}} of beer.
Take one down and pass it around {{=bottles (i-1)}} of beer on the wall.
{{end}}
{{end-}}

This is free and unencumbered software released into the public domain.