
On further reflection I have a question.
Under the limited design below, which Edward says will do all he wants:
· The mutually recursive classes (call them A, B, C) must be defined all together. Like
class B a => A a; class C a => B a; class A a => C a
· If a type T is an instance of any of those classes, it must be a member of all of them
· If a function f has type f :: A a => blah, then the signature f :: B a => blah and f :: C a => blah would work equally well
In short, I see no advantage to making A,B,C separate classes compared to simply unioning them into a single class.
Bottom line: adding recursive superclasses with the restrictions I describe below would add no useful expressive power. But it would cost effort to implement. So why do it?
Maybe I’m missing something.
Simon
From: Edward Kmett [mailto:ekmett@gmail.com]
Sent: 22 July 2011 20:07
To: Simon Peyton-Jones
Cc: Gábor Lehel; glasgow-haskell-users@haskell.org
Subject: Re: Superclass Cycle via Associated Type
2011/7/22 Simon Peyton-Jones