partially applied type synonyms
ariep at xs4all.nl
Thu Jul 27 11:43:31 EDT 2006
Is there a good reason that partially applied type synonyms cannot be made
instances of classes?
- A simple example would be making the identity type 'Id' ("type Id x =
x") instance of 'Monad'. This would eliminate the need for some silly
occurrences of 'runIdentity', and perhaps narrow the gap between monads
and monad transformers.
- The reason I complain about this now is a more involved example, where
introducing a newtype to work around the restriction is not an option.
Well, not as far as I can see now, anyway.
Partially applied type synonyms are, in a sense, the anonymous functions
at the type level, and one might argue that they deserve the same
'first-class member status' as the lambda at the value level.
More information about the Glasgow-haskell-users