[Haskell] Empty instance declaration

Isaac Dupree isaacdupree at charter.net
Fri Dec 28 11:49:30 EST 2007

Ralf Laemmel wrote:
> Isaac wrote:
>> I wonder whether it would be safe for the compiler to infer simply by
>> the default methods mentioning each other in a cycle.  It might miss
>> some cases when (probably involving laziness) the default methods
>> actually terminate and form an intended set of implemention, and warn
>> when it shouldn't... which is bad, but does that ever happen?
> "mentioning each other in a cycle" is too imprecise unfortunately at
> least for two reasons:
> a) we could face a well-designed mutual recursion.
> b) we could face co-induction.

I know!  I said so!  My question is whether anyone has an example of 
doing either of those in mutually-recursive DEFAULT METHOD definitions?

sorry for yelling

You did not say anything that's imprecise about "mentioning each other 
in a cycle", just the well-known fact that it's not equivalent to total 
termination checking (in fact, it's neither fully an overestimate nor 
underestimate of termination -- it's just an estimate that's likely to 
be right when used in the context of default method definitions).


More information about the Haskell mailing list