[Haskell] Re: Type synonyms in the instance head

Ashley Yakeley ashley at semantic.org
Thu Feb 2 15:53:15 EST 2006

Mads Lindstrøm wrote:
> "You cannot, for example, write:
>   type P a = [[a]]
>   instance Monad P where ...
> This design decision is independent of all the others, and easily
> reversed, but it makes sense to me."

It's not clear to me how this can be reversed. Wouldn't reversing this 
mean introducing "type lambda", and doesn't that raise all kinds of 
nasty issues (like having to type-annotate function applications)?

> If I have:
> data LongAndUglyName a = ...
> type ShortAndTellingName a = LongAndUglyName a
> It seems to make sensible to:
> instance Foo ShortAndTellingName

You can do this instead:

type ShortAndTellingName = LongAndUglyName

Ashley Yakeley

More information about the Haskell mailing list