Re: Type classes in GADTs

2008-10-30 Thread Jason Dagit
On Wed, Oct 29, 2008 at 10:20 PM, C Rodrigues [EMAIL PROTECTED] wrote: I discovered that closed type classes can be implicitly defined using GADTs The GADT value itself acts like a class dictionary. However, GHC (6.83) doesn't know anything about these type classes, and it won't infer any

Re: Type classes in GADTs

2008-10-30 Thread Daniil Elovkov
Jason Dagit wrote: On Wed, Oct 29, 2008 at 10:20 PM, C Rodrigues [EMAIL PROTECTED] wrote: I discovered that closed type classes can be implicitly defined using GADTs The GADT value itself acts like a class dictionary. However, GHC (6.83) doesn't know anything about these type classes, and

file descriptors

2008-10-30 Thread Johannes Waldmann
Dear all, are there any known issues with file handles/descriptors in ghc-compiled executables? My program has a lot of calls to System.Process.runInteractiveProcess and I'm running into unpredictable behaviour (sometimes the program just silently dies, sometimes it gets stuck) The handles I

RE: Type classes in GADTs

2008-10-30 Thread C Rodrigues
Thanks for the explanation. I see how this wouldn't behave nicely with automatic class constraint inference. I didn't test the example on any other GHC versions. I will probably end up passing in the Eq dictionary from outside like Daniil suggested. I would prefer to do the following, but

Re: Type classes in GADTs

2008-10-30 Thread Thomas Schilling
2008/10/30 C Rodrigues [EMAIL PROTECTED]: evidenceOfEq :: CAOp a - (Eq a = b) - b isn't that the same as: evidenceOfEq :: Eq a = CAOp a - b - b Neither does it accept data EqConstraint a b = EqConstraint (Eq a = b). Foiled again. same here: data Eq a = EqConstraint a b =

RE: gadt changes in ghc 6.10

2008-10-30 Thread Simon Peyton-Jones
| In your case the error message was: | | GADT.hs:26:56: | GADT pattern match with non-rigid result type `Maybe a' | Solution: add a type signature | In a case alternative: I1 m' - m' | In the expression: case w' S of { I1 m' - m' } | In a case alternative: Wrap w' - case

Re: file descriptors

2008-10-30 Thread Brandon S. Allbery KF8NH
On 2008 Oct 30, at 10:08, Johannes Waldmann wrote: are there any known issues with file handles/descriptors in ghc-compiled executables? My program has a lot of calls to System.Process.runInteractiveProcess and I'm running into unpredictable behaviour (sometimes the program just silently dies,