[Haskell-cafe] bug in ghci ?

Ben Millwood haskell at benmachine.co.uk
Thu Jul 8 12:24:05 EDT 2010


On Thu, Jul 8, 2010 at 3:45 PM, Daniel Fischer <daniel.is.fischer at web.de> wrote:
>
> Well, I made the suggestion of emitting a warning on instance declarations
> without method definitions. That would be comparatively easy to implement
> (even with an additional check to only emit the warning if the class
> defines any methods) and catch many (if not most) cases.
>

Unfortunately, it would catch some perfectly valid cases, see the list
of instances for flat datatypes here:

http://hackage.haskell.org/packages/archive/deepseq/1.1.0.0/doc/html/src/Control-DeepSeq.html

This demonstrates that there is at least one (admittedly probably not
much more than one) case where a class with methods would have a
default implementation that was total and valid in some cases.


More information about the Haskell-Cafe mailing list