
For an associated data type D, we know that the type function D is
injective, i.e., for different indicies given to D we'll get different
data types. This makes much more powerful reasoning possible in the
type checker. If associated data types are removed there has to be
some new mechanism to declare an associated type as injective, or the
type system will lose power.
-- Lennart
2008/12/10 Eyal Lotem
If we have associated type synonyms, is there still reason to have associated data types?
For example, we can replace:
class C b where data D b ...
instance C Int where data D Int = D | E
with:
class C b where type D b ...
data DInt = D | E instance C Int where type D Int = DInt
Or perhaps allow, for convenience, this form (which would desugar to the above):
class C b where type D b ...
instance C Int where data D Int = D | E _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe