Language.Haskell.Parser and literate Haskell source

Hello, Are there ability to parse literate haskell source with Language.Haskell.Parser, or maybe there is some tool, which converts .lhs files to .hs ? Thanks in advance. -- Best regards, Vasyl Pasternak

On Mon, Apr 13, 2009 at 3:37 PM, Vasyl Pasternak
Hello,
Are there ability to parse literate haskell source with Language.Haskell.Parser, or maybe there is some tool, which converts .lhs files to .hs ?
You can ask GHC to remove the literate bits. I think the command is called 'unlit' but check the GHC manual to be sure. Jason

Jason,
Thank you for your answer. I haven't found unliterate capability in GHC, but I
found unlit function in Distribution.Simple.PreProcess.Unlit, which do the
things I needed.
Best regards,
Vasyl
2009/4/14 Jason Dagit
On Mon, Apr 13, 2009 at 3:37 PM, Vasyl Pasternak
wrote: Hello,
Are there ability to parse literate haskell source with Language.Haskell.Parser, or maybe there is some tool, which converts .lhs files to .hs ?
You can ask GHC to remove the literate bits. I think the command is called 'unlit' but check the GHC manual to be sure.
Jason

Are there ability to parse literate haskell source with Language.Haskell.Parser, or maybe there is some tool, which converts .lhs files to .hs ?
Use the haskell-src-exts package instead of haskell-src. The function parseFile in Language.Haskell.Exts will de-literate the file for you if the suffix is .lhs. Cheers, /Niklas

Niklas,
I suspected that haskell-src-exts should have this function, but it
was undocumented :)
Thank you for the tip.
Best regards,
Vasyl
2009/4/14 Niklas Broberg
Are there ability to parse literate haskell source with Language.Haskell.Parser, or maybe there is some tool, which converts .lhs files to .hs ?
Use the haskell-src-exts package instead of haskell-src. The function parseFile in Language.Haskell.Exts will de-literate the file for you if the suffix is .lhs.
Cheers,
/Niklas
participants (3)
-
Jason Dagit
-
Niklas Broberg
-
Vasyl Pasternak