[Haskell-cafe] bug in ghci ?

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Thu Jul 8 09:47:09 EDT 2010


"Pasqualino \"Titto\" Assini" <tittoassini at gmail.com> writes:

> Thanks for the explanation.
>
> What I meant is not that is a bug that it recurses but rather the fact
> that the compiler will accept this incomplete definition without
> complaining.
>
> This problem has bitten me twice while trying to use automatic
> derivation of a data type in another file.
>
> In my innocence I wrote:
>
> instance Show Test
>
> rather than
>
> deriving  instance Show Test
>
> I didn't notice the error as GHC seemed to be happy and then when I
> tried to use it: BANG!
>
> Very confusing.
>
> I suppose that Haskell has spoiled me, if it compiles I assume that it
> will work :-)

As I said, there would be no error as all the methods have a definition
(whether or not they make sense in this case is a different story); it
will still successfully load a file if any methods don't have
definitions but will provide a warning in those situations.

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list