a type question

rui yang r2yang at engmail.uwaterloo.ca
Wed Nov 26 17:59:29 EST 2003


Thanks. 
What I really want to know is:
How to describe a new type (Funcmap) which is itself a function type like a->b-
>c so that I can use this new type in other functions? for example, I can 
define some other functions like:

theta  :: Functionmap -> d ->e

minus  :: Funcmap ->......

I can put all the things there like :
theta  :: (a->b->c)->d->e
but sometimes it's not convenient to do so.

rui



ÒýÓÃ Lennart Augustsson <lennart at augustsson.net>:

> rui yang wrote:
> > Suppose I have a function:
> > 
> >  funcmap  :: a->b->c
> > 
> > can I use type synonyms to describe a new type like this:
> >  Type Funcmap  = a->b>c ?
> 
> First, it's 'type' not 'Type'.
> Second, you want '->' not '>'.
> Third, all type variables in the RHS must be on the LHS.
> So, we get
> 
> 	type Funcmap a b c = a->b->c
> 




----------------------------------------
This mail sent through www.mywaterloo.ca


More information about the Haskell mailing list