Convert haskell source files between hs and lhs formats
Haskell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
hs2lhs.hs

README.md

Literate

hs2lhs

hs2lhs is a script to convert haskell source files (.hs) to bird style literate haskell files (.lhs).

Usage:

./hs2lhs myprog.hs > myprog.lhs

Converting hs to lhs requires making some fairly arbitrary decision about how to handle comments. hs2lhs makes any comment begininng with -- (including haddock comments) into plain lhs text and leaves any other comments (includinge {- ... -}) embedded in the code. Of course there are many examples that won't convert as you expect, since coding styles vary. Consider hs2lhs generated files as the first step in converting to literate haskell.