24 Mar
2003
24 Mar
'03
9:02 a.m.
I think I get it. But to be sure: The forall means: The type for a may not be the same throughout the whole function. It just has to follow the pattern specified inside the braces. Interestingly, when I want hugs to show me the type of
fun::(forall a.[a]->Int)->[b]->[c]->Int it tells me: ERROR - Use of fun requires at least 1 argument Why that? At least I have explicitely specified the type.
Markus
One may want:
fun f x y = f x + f y
for instance:
fun length [True, False] [1,2]
Therefore, I would say, you need typing a la
fun::(forall a.[a]->Int)->[b]->[c]->Int
Ciao, Steffen