Re: precedence bug with derived instances

2002-10-31 Thread Christian Sievers
Dean Herington wrote: > > Why is that expression not type-correct? > > [Answering my own question...] > > Duh. Because the type doesn't partake of Eq. Right. Of course, it's a different kind of error than for example [Orange] == Orange --- where no Eq Color instance decl would help, and I w

Re: precedence bug with derived instances

2002-10-30 Thread Dean Herington
Dean Herington wrote: > On Tue, 29 Oct 2002, Christian Sievers wrote: > > > I guess "equivalent" just means equality without suggesting that the type is > > an instance of Eq. There are other places where the report uses == in > > situations where you can't really apply it, for example, in D.2 it

RE: precedence bug with derived instances

2002-10-29 Thread Dean Herington
On Tue, 29 Oct 2002, Christian Sievers wrote: > I guess "equivalent" just means equality without suggesting that the type is > an instance of Eq. There are other places where the report uses == in > situations where you can't really apply it, for example, in D.2 it says > "we would have >

RE: precedence bug with derived instances

2002-10-29 Thread Dean Herington
On Tue, 29 Oct 2002, Simon Peyton-Jones wrote: > Some last-ditch H98 stuff. I have the proofs now and have to send them > back this week. Changes will become impossible (or at least much > harder) after that. Ah well, I'm sure more errors will come to light. > > Simon > > > | > | (3) Section

RE: precedence bug with derived instances

2002-10-29 Thread Christian Sievers
Simon Peyton-Jones wrote: > I can only make minimal changes now. I suspect the smallest change is > to require that > (x,"") `elem` readsPrec d (showsPrec d x "") > > This weakens the existing equation by not requiring (x,"") to be the > first parse returned. > > Dean writes: > | Perha

RE: precedence bug with derived instances

2002-10-29 Thread Simon Peyton-Jones
Some last-ditch H98 stuff. I have the proofs now and have to send them back this week. Changes will become impossible (or at least much harder) after that. Ah well, I'm sure more errors will come to light. Simon | > | (3) Section D.4 gives the expected rule: | > | | > | head (readsPrec d

Re: precedence bug with derived instances

2002-10-28 Thread Dean Herington
Simon Peyton-Jones wrote: > | (1) In the first section, in: > | > | instance (cx, cx') => Ci (T u1 ... uk) where { d } > | > | the use of "(cs, cs')" is a bit loose (that is, suggestive rather than > | precise syntax). One can't (according to the report, though GHC seems > to > | allow it) ha

RE: precedence bug with derived instances

2002-10-22 Thread Simon Peyton-Jones
| (1) In the first section, in: | | instance (cx, cx') => Ci (T u1 ... uk) where { d } | | the use of "(cs, cs')" is a bit loose (that is, suggestive rather than | precise syntax). One can't (according to the report, though GHC seems to | allow it) have nested parentheses in a context, which

Re: precedence bug with derived instances

2002-10-18 Thread Dean Herington
Simon Peyton-Jones wrote: > | In GHC 5.04.1, derived instances of Show mishandle precedence: > | > | Prelude> putStrLn (showsPrec 10 (Just 0) "") > | Just 0 > | > | The result should be: (Just 0) > > I think it's a bug in the Report, not in GHC, actually. The Report says > (Section D.4) > > "

RE: precedence bug with derived instances

2002-10-18 Thread Simon Peyton-Jones
| In GHC 5.04.1, derived instances of Show mishandle precedence: | | Prelude> putStrLn (showsPrec 10 (Just 0) "") | Just 0 | | The result should be: (Just 0) I think it's a bug in the Report, not in GHC, actually. The Report says (Section D.4) "The function 'showsPrec d x r' accepts a pre