ghc5.04.1 deriving Read/Show broken

Simon Marlow simonmar at microsoft.com
Tue Sep 17 05:40:23 EDT 2002


> Luckily, there is a workaround (discovered by Tom Moertel on
> #haskell).  If you include field names in the data
> definition for which you derive Show and Read, it seems to
> work fine.  
> 
> So, in George's example
> 
>   module GHCBug where
> 
>   data Command =
> 	NewLocation 
>      |  Commit {a :: Int, b :: String, c :: (Maybe String)}
>      |  Retrieve String String
>      |  ListVersions String
> 	deriving (Read,Show)
> 
> should be all that is needed.
> 
> It seems that as soon as the value of the Maybe type is
> delimited by a punctuation symbol or bracket, all is fine.

Thanks.  I've added a note to the download page for 5.04.1 about this
bug.

Given that there's a workaround, we won't do 5.04.2 immediately but
we'll certainly move along to 5.04.2 quicker than we would have
otherwise.

Cheers,
	Simon



More information about the Glasgow-haskell-bugs mailing list