[Haskell-cafe] Derived Read instance for types with infixconstructors (ghc 6.4.1)

Simon Peyton-Jones simonpj at microsoft.com
Mon Sep 4 09:25:21 EDT 2006

| Another thing:
| Would it be a good idea to create derived Read instances that could
| both, "A `And` A" and "And A A" ?
| Since 6.4.2 parses the former and 6.2.2 parses the latter that should
| possible, I believe (and both forms are accepted at the ghci prompt).

Well, the Haskell 98 Report says that the derived Read will only read
the infix form if you declare the constructor infix, and vice versa.
(Similarly records.)

Technically it'd be very easy to make the change, although code size
would increase a bit.   We won't do it in 6.6 though.


More information about the Haskell-Cafe mailing list