[Haskell-cafe] How to understand the 'forall' ?

zaxis z_axis at 163.com
Wed Sep 2 01:16:54 EDT 2009


Isnot it clear without the 'forall' ?
data Branch tok st a = Branch (PermParser tok st (b -> a)) (GenParser tok st
b)

thanks!


jkff wrote:
> 
> This means that for any type 'b' you can construct a value of type
> 'Branch tok st a' by passing to Branch an argument of type
> '(PermParser tok st (b -> a))' and 'GenParser tok st b'.
> This also means that when you're given a value of type Branch tok st
> a, you don't know what that 'b' type was; the only thing you know is
> that the 'b' in 'b -> a' in the first argument of Branch is the same
> as the 'b' in 'GenParser tok st b'.
> 
> See also: the haskellwiki page on existential types.
> 
> 2009/9/2 zaxis <z_axis at 163.com>:
>>
>> data Branch tok st a = forall b. Branch (PermParser tok st (b -> a))
>> (GenParser tok st b)
>>
>> please shed a light on me, thanks!
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-understand-the-%27forall%27---tp25250783p25250783.html
>> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
> 
> 
> 
> -- 
> Eugene Kirpichov
> Web IR developer, market.yandex.ru
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-understand-the-%27forall%27---tp25250783p25251783.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list