[Haskell-cafe] Haddock bug for strict unpacked fields?
David Waern
david.waern at gmail.com
Wed Jan 21 14:54:01 EST 2009
2009/1/21 Stephan Friedrichs <deduktionstheorem at web.de>:
> Hi,
>
> using haddock-2.4.1 and this file:
>
>> module Test where
>>
>> data Test
>> = NonStrict Int
>> | Strict !Int
>> | UnpackedStrict {-# UNPACK #-} !Int
>
> The generated documentation looks like this:
>
> data Test
> Constructors
> NonStrict Int
> Strict !Int
> UnpackedStrict !!Int
>
> Note the double '!' in the last constructor. This is not intended
> behaviour, is it?
This is the way GHC pretty prints unboxed types, so I thought Haddock
should follow the same convention. Hmm, perhaps Haddock should have a
chapter about language extensions in its documentation, with a
reference to the GHC documentation. That way the language used is at
least documented. Not sure if it helps in this case though, since "!!"
is probably not documented there.
Perhaps we should not display unbox annotations at all since they are
an implementation detail, right? We could display one "!" instead,
indicating that the argument is strict.
David
More information about the Haskell-Cafe
mailing list