[Haskell-cafe] bug in ghci ?

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri Jul 9 19:26:13 EDT 2010

"Kevin Quick" <quick at sparq.org> writes:

> I would think that only mutually recursive default methods would
> require respecification and that there could be any number of default
> methods that were reasonable as is.  Since it's probably quite
> difficult for the Haskell compiler to analytically detect
> non-terminating v.s. terminating mutual recursion it may be useful to
> define an explicit comment flag for this case.
> For example:
>    class Show a where
>       shows = showsPrec 5
>       showsPrec _ = shows
>       {-# REDEFINE_ONE: shows showsPrec #-}
> This would fairly simply allow a warning to be generated for an
> instance which did not redefine one of the identified methods; it
> would capture that requirement in the same place the recursive
> definition was defined, it would avoid false warnings, and it would be
> backward compatible (and it might be Haddock-able as well).

This should be generalised IMO, since there might be cases where you
have to redefine either (foo && bar) || baz; of course, that makes the
syntax specification, etc. of the pragma more difficult...

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list