Skip to content
Convert haskell source files between hs and lhs formats
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



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


./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.

You can’t perform that action at this time.