Skip to content

haddock fails to parse {- # ... #-} (note the space) pragma #171

Open
ghc-mirror opened this Issue May 8, 2014 · 4 comments

2 participants

@ghc-mirror

Original reporter: slyfox@<hidden>

The problem was found on xmonad-0.9.2 haddock failure.

Minimal complete test looks as such:

$ haddock Fail.hs 

Fail.hs:1:3: parse error on input `#'
$ cat Fail.hs
{- # OPTIONS_GHC -fglasgow-exts    #-}

module Fail where

Reproducible with haddock-2.7.2 and 2.9.2.

@ghc-mirror ghc-mirror self-assigned this May 8, 2014
@ghc-mirror

Original reporter: isaacdupree

So:

That's not a pragma, according to Haskell standard (IIRC); it's a comment.

Next, Haddock looks at it as a comment, as it looks at all comments, to determine whether it is Haddockumentation.

Comments -- # or {- # denoted a Haddock-pragma in Haddock 0.x (rather as -- | and {- | denote Haddock-comments still). Could that be related?

@ghc-mirror

Original reporter: david.waern@<hidden>

Comments -- # or {- # denoted a Haddock-pragma in Haddock 0.x (rather as -- | and {- | denote Haddock-comments still). Could that be related?

Yes, I think that's it. We still support that form, but we should probably just get rid of it.

@ghc-mirror

Original reporter: fuuzetsu@<hidden>

I'm going to see whether we can get rid of the -- # form all together before 7.8. It hasn't been documented for ages and the bug is just remains of 0.x to begin with (although still present).

@ghc-mirror

Original reporter: fuuzetsu@<hidden>

Relevant GHC ticket http://ghc.haskell.org/trac/ghc/ticket/8226

@Fuuzetsu Fuuzetsu assigned Fuuzetsu and unassigned ghc-mirror May 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.