Haddock : parse error on input `{-# UNPACK'

Hi all, I'm trying to compile the binary-strict module from hackage and I'm getting the exact same error as in the hackage build log: http://hackage.haskell.org/packages/archive/binary-strict/0.4.2/logs/failure... src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input `{-# UNPACK' Is this a bug? Is there any way to work around it? TIA, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

Erik de Castro Lopo
src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input `{-# UNPACK'
Is this a bug? Is there any way to work around it?
This is a haddock error and I presume a bug in haddock. I don't know whether cabal installs things if haddock fails. You could do ghc-pkg list and see what's there. If it didn't install then you can install "by hand": 1. Extract the sources and in that directory: 2. runghc Setup.lhs configure 3. runghc Setup.lhs build 4. runghc Setup.lhs install You might want to do configure with --user - that's what cabal defaults to. Dominic

Dominic Steinitz wrote:
Erik de Castro Lopo
writes: src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input `{-# UNPACK'
Is this a bug? Is there any way to work around it?
This is a haddock error and I presume a bug in haddock.
Well I raised a bug here: http://trac.haskell.org/haddock/ticket/109
I don't know whether cabal installs things if haddock fails.
Thats actually not the problem. I'm trying to build a debian package for this thing and this haddock problem is preventing that. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

Erik de Castro Lopo
Dominic Steinitz wrote:
Erik de Castro Lopo
writes: src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input `{-# UNPACK'
This is a haddock error and I presume a bug in haddock.
Well I raised a bug here:
http://trac.haskell.org/haddock/ticket/109
Thats actually not the problem. I'm trying to build a debian package for this thing and this haddock problem is preventing that.
Erik
This seems to be the problem: http://hackage.haskell.org/trac/hackage/ticket/230. There's obviously a work round for it as the haddock for the binary package builds (e.g. http://hackage.haskell.org/packages/archive/binary/0.5.0.1/doc/html/Data-Bin...) but I don't know what it is. What's even more frustrating is one of the authors of has tried: #ifndef __HADDOCK__ -- | The parse state data S = S {-# UNPACK #-} !BL.ByteString -- ^ input {-# UNPACK #-} !Int -- ^ bytes read {-# UNPACK #-} ![B.ByteString] {-# UNPACK #-} !Int -- ^ the failure depth #endif and haddock ignores this. And the binary package just has this (no ifdefs!): -- Our internal buffer type data Buffer = Buffer {-# UNPACK #-} !(ForeignPtr Word8) {-# UNPACK #-} !Int -- offset {-# UNPACK #-} !Int -- used bytes {-# UNPACK #-} !Int -- length left Perhaps one of the authors of binary can tell us their secret of success? Dominic.

Dominic Steinitz
Erik de Castro Lopo
writes: Dominic Steinitz wrote:
Erik de Castro Lopo
writes: src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input `{-# UNPACK'
This is a haddock error and I presume a bug in haddock.
Well I raised a bug here:
Ha! It's yet another of haddock's quirks. If I replace -- ^ by -- then haddock accepts {-#. I'll update the ticket you created. -- | The parse state data S = S {-# UNPACK #-} !BL.ByteString -- ^ input {-# UNPACK #-} !Int -- ^ bytes read {-# UNPACK #-} ![B.ByteString] {-# UNPACK #-} !Int -- ^ the failure depth -- | The parse state data S = S {-# UNPACK #-} !BL.ByteString -- input {-# UNPACK #-} !Int -- bytes read {-# UNPACK #-} ![B.ByteString] {-# UNPACK #-} !Int -- the failure depth Dominic.

Dominic Steinitz wrote:
-- | The parse state data S = S {-# UNPACK #-} !BL.ByteString -- ^ input {-# UNPACK #-} !Int -- ^ bytes read {-# UNPACK #-} ![B.ByteString] {-# UNPACK #-} !Int -- ^ the failure depth
-- | The parse state data S = S {-# UNPACK #-} !BL.ByteString -- input {-# UNPACK #-} !Int -- bytes read {-# UNPACK #-} ![B.ByteString] {-# UNPACK #-} !Int -- the failure depth
Thanks Dominic. Thats a workaround I can use. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

2009/6/7 Dominic Steinitz
Ha! It's yet another of haddock's quirks. If I replace -- ^ by -- then haddock accepts {-#. I'll update the ticket you created.
-- | The parse state data S = S {-# UNPACK #-} !BL.ByteString -- ^ input {-# UNPACK #-} !Int -- ^ bytes read {-# UNPACK #-} ![B.ByteString] {-# UNPACK #-} !Int -- ^ the failure depth
-- | The parse state data S = S {-# UNPACK #-} !BL.ByteString -- input {-# UNPACK #-} !Int -- bytes read {-# UNPACK #-} ![B.ByteString] {-# UNPACK #-} !Int -- the failure depth
Haddock doesn't actually support comments on individual constructor arguments. People often get confused by this, and the error message isn't especially useful. We have a ticket for giving better error messages: http://trac.haskell.org/haddock/ticket/94 We also have a ticket about the feature itself: http://trac.haskell.org/haddock/ticket/95 David
participants (3)
-
David Waern
-
Dominic Steinitz
-
Erik de Castro Lopo