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.