type aliases in instances

Bernhard Reus bernhard@cogs.susx.ac.uk
Thu, 07 Mar 2002 12:05:38 +0000

In Haskell type aliases are not allowed in instance definitions.  Is
there a particular reason for this? For example, is there a problem with
type inference? 

I noticed that when composing monads (in the Moggi/Wadler style) one
easily ends up with a cascade of coercions enforced by datatype
declarations. Looks a bit tedious. This can be avoided by using type
aliases but then the monads in use cannot be instances of the Monad
class. Phil uses aliases in his "Essence of functional programming"
paper too. But not declaring the monads to be in class Monad can hardly
be good style, can it?

Many thanks for your help in advance.


Bernhard Reus,  COGS
University of Sussex