Skip to content

Module without a 'module' header breaks -haddock

Summary

This piece of code can not be parsed in -haddock mode:

-- | Foo
main = main
$ ghc -haddock /tmp/e.hs

/tmp/e.hs:2:1: error: parse error on input ‘main’
  |
2 | main = main
  | ^^^^

It parses fine without -haddock.

Environment

  • GHC version used: 8.8.1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information