Re: [Haskell-cafe] Infix instance headers

2010-01-08 Thread Bas van Dijk
Simon,

I discovered that the following example also won't parse in ghc-6.12.1
because of the infix 'MayOpen' constraint:

with ∷ (Resource resource, MonadCatchIO pr)
 ⇒ resource
 → (∀ s. s `MayOpen` resource ⇒ RegionalHandle resource (RegionT s
pr) → RegionT s pr α)
 → pr α

Is this also fixed by your previous patch?

regards,

Bas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Infix instance headers

2009-12-23 Thread Bas van Dijk
OK thanks,

Bas

On Wed, Dec 23, 2009 at 10:50 AM, Simon Peyton-Jones
simo...@microsoft.com wrote:
 Ah I see.  It's an oversight. Thank you for pointing that out.

 I'll fix it, but it'll be in the HEAD not 6.12.

 Simon

 | -Original Message-
 | From: Bas van Dijk [mailto:v.dijk@gmail.com]
 | Sent: 22 December 2009 10:52
 | To: Simon Peyton-Jones
 | Subject: Re: [Haskell-cafe] Infix instance headers
 |
 | On Tue, Dec 22, 2009 at 9:53 AM, Simon Peyton-Jones
 | simo...@microsoft.com wrote:
 |  works for me. what version of GHC are you using?
 |
 | ghc-6.12.1
 |
 | Sorry, maybe I wasn't totally clear. The example I posted works but if
 | you write the class name in the instance header as infix I get a
 | Malformed instance header error.
 |
 | So the following doesn't work:
 |
 | class (Monad pr, Monad cr) = pr `ParentOf` cr
 |
 | instance Monad r = r `ParentOf` r
 |
 | instance ( Monad cr
 |          , cr `TypeCast2` RegionT resource s pcr
 |          , pr `ParentOf` pcr
 |          )
 |          = pr `ParentOf` cr
 |
 | regards,
 |
 | Bas


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Infix instance headers

2009-12-21 Thread Bas van Dijk
Hello,

What's the reason that infix class declarations and infix constraints
are supported but infix instance heads aren't?

For example the following code from my regions package is allowed but
writing the instance header infix results in a Malformed instance
header error:

class (Monad pr, Monad cr) = pr `ParentOf` cr

instance Monad r = ParentOf r r

instance ( Monad cr
 , cr `TypeCast2` RegionT resource s pcr
 , pr `ParentOf` pcr
 )
 = ParentOf pr cr

regards,

Bas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe