RE: higher-order typing errors

2003-01-23 Thread Simon Peyton-Jones
]] | 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

Re: higher-order typing errors

2003-01-23 Thread Tomasz Zielonka
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

RE: higher-order typing errors

2003-01-23 Thread Simon Peyton-Jones
| 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

higher-order typing errors

2003-01-22 Thread Dean Herington
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 `,'