Parse literate Haskell file

tldr: is it possible to parse a literate Haskell file with parseModuleEpAnnsWithCppInternal?

longer question: I’m trying to contribute to doctest-parallel so that it is able to handle literate Haskell files.

Currently I get to a point where parseModuleEpAnnsWithCppInternal is called and fails with the following error message

parse error on input `>'

indicating that it is not able to parse a literate Haskell file. Is there a way to parse a literate Haskell file this way? Maybe setting something in the CppOptions or in the DynFlags arguments?

1 Like

Literate Haskell is handled by unlit before the parser. You can see how Scrod does it here: scrod/source/library/Scrod/Executable/Main.hs at main · tfausak/scrod · GitHub (line 64).

5 Likes