sol/doctest

Placing a haddock line inbetween the module declaration and the imports results in a parse error

appestat opened this issue · 2 comments

module Error where
-- | test
import Prelude

results in a parse error in GHC, while

module Error where
-- test
import Prelude

does not. Furthermore,

module Error where
-- | test

also does not produce an error.
This is related to #167, but this is just a haddock line and not anything doctest specific. If it's not possible to fix like #167 should this be added to the readme as well?
Output of doctest --version:

doctest version 0.16.2
using version 8.6.5 of the GHC API
using /usr/local/Cellar/ghc/8.6.5/bin/ghc-8.6.5

That haddock placement also breaks haddock in the same way.

Do you think it makes sense to document that doctest requires your comments to be legal according to haddock? That requirement makes sense to me, and chances are that you don't want broken haddocks anyway.

I think that's totally reasonable, yeah. Thanks!