Re: a type question

2003-11-26 Thread Brandon Michael Moore
It depends what sort of polymorphism you want theta to have. If your function types involve concrete types you could write something like type IntMap = Int -> Bool -> String and then say theta :: IntMap -> Int -> String If you want the argument function to be completely polymorphic you can say t

Re: a type question

2003-11-26 Thread rui yang
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

Re: a type question

2003-11-26 Thread Lennart Augustsson
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 type question

2003-11-26 Thread rui yang
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 ? it will give a syntax error message: syntax error in input (unexpected '->'), does anyone know how to define this Funcmap type? rui -