[Haskell] Empty instance declaration
rlaemmel at gmail.com
Fri Dec 28 11:41:54 EST 2007
> 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.
The ultimate solution is to extend type signatures by termination
requirements and to have a termination checker enforcing them.
For instance, Andreas Abel has done groundbreaking work on termination checking.
More information about the Haskell