Joergen Froejk Kjaersgaard wrote:
> I want [Foo] to mean a list of
> elements of types of class Foo. When a list is built, each element is
> augmented with pointers to the functions defined in class Foo for its
> concrete type. The only operations allowed on elements in a list of
> [Foo] are the operation defined in class [Foo].
This feels very much like union types - I thought union types were
considered undesirable for lots of reasons ... ???
A more concrete question; using your definition of Foo and its
instances, would the following function be well defined:
i :: [Int] -> [Foo]
i l = l
Bart Demoen