Ben Rudiak-Gould wrote:
> The way to think about it is that foralls are extra function arguments. 
> Your first example is like
> 
>   foo :: Integer -> (a::Type -> Show a -> a)
> 
> so a is chosen by the caller, not by you. The second case is like
> 
>   bar :: Integer -> (a::Type -> Show a -> a -> b) -> b
> 
> In order for the first case to work as you expect, you'd need the type
> 
>   foo :: Integer -> (a::Type, Show a, a)
> 
> which is traditionally written
> 
>   foo :: Integer -> (exists a. Show a => a)

    I thought "exists" was spelled "forall" in Haskell?

Greg Buchholz
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to