[Haskell-cafe] How to understand the 'forall' ?
ekirpichov at gmail.com
Tue Sep 1 23:20:38 EDT 2009
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
Web IR developer, market.yandex.ru
More information about the Haskell-Cafe