
Hello all, I have a syntax issue (hopefully!) -- this is perfectly fine: data Unary = forall a. Unary a -- this one as well: data Binary = forall a. Binary a a -- but not this one -- parse error on input forall :( data Binary' = forall a. forall b. Binary' a b I tried different kinds of bracketings and orderings but no luck... Best, -- Ozgur Akgun

On Wed, Mar 24, 2010 at 6:31 PM, Ozgur Akgun
What was I thinking?
A sensible thought if you asked me. It's certainly a surprise to me that this isn't allowed. Because in any other context binders, like lambdas and foralls, may be freely nested. For example: {-# LANGUAGE RankNTypes #-} swap :: forall a. forall b. a -> b -> (a, b) swap = \x -> \y -> (x,y) {-# LANGUAGE PolymorphicComponents #-} data Foo = Foo (forall a. forall b. a) regards, Bas

I tried forall a,b. Binary' a b and the *what was I thinking* comment was
for that.
And I absulutely agree with you on the nesting part. That's what came to my
mind at the first glance for obvious reasons.
On 24 March 2010 20:27, Bas van Dijk
On Wed, Mar 24, 2010 at 6:31 PM, Ozgur Akgun
wrote: What was I thinking?
A sensible thought if you asked me.
It's certainly a surprise to me that this isn't allowed. Because in any other context binders, like lambdas and foralls, may be freely nested. For example:
{-# LANGUAGE RankNTypes #-} swap :: forall a. forall b. a -> b -> (a, b) swap = \x -> \y -> (x,y)
{-# LANGUAGE PolymorphicComponents #-} data Foo = Foo (forall a. forall b. a)
regards,
Bas
-- Ozgur Akgun
participants (3)
-
Bas van Dijk
-
Ozgur Akgun
-
Stephen Tetley