]]
| Sent: 22 January 2003 23:03
| To: [EMAIL PROTECTED]
| Subject: higher-order typing errors
|
| I don't understand why GHC (I was using 5.04.2) should reject these
two
| programs.
|
|
|
| {-# OPTIONS -fglasgow-exts #-}
|
| swap1 :: (forall a. a - a, forall
Hi!
On Thu, Jan 23, 2003 at 10:28:13AM -, Simon Peyton-Jones wrote:
To get around it, define your own data type:
data MyPr = MyPr (forall a.a-a) (forall a.a-a)
swap1 :: MyPr - MyPr
I played a bit with using highed order polymorphism for this problem,
and have encountered
| The first version doesn't compile - the error is:
| Type synonym `F3' should have 1 argument, but has been given 0
| In the type: Pair F3 F2
| While checking the type signature for `p'
Type synonyms in Haskell must be saturated (i.e. given all their
argments).
GHC lifts this restriction
I don't understand why GHC (I was using 5.04.2) should reject these two
programs.
{-# OPTIONS -fglasgow-exts #-}
swap1 :: (forall a. a - a, forall a. a - a - a)
- (forall a. a - a - a, forall a. a - a)
swap1 (a, b) = (b, a)
yields:
Bug2.hs:3: parse error on input `,'