"Kevin Quick" <[email protected]> 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 [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
