RE: [Template-haskell] RE: [ ghc-Bugs-820778 ] Malformed Predicate w/ Template Haskell
I was wrong. Multi-parameter classes are there. What was wrong was that Jon Cast's program constructed the predicate varT "Flatten" `appT` t whereas he should have used "conT". So there are two issues really: 1. It is in fact legal to have predicates like (m Int) forall m. (m Int) => ... but hsSyn/Convert.lhs didn't handle that. I've fixed that. 2. But it's really an error to allow (varT "T") or (conT "x") at all. Haskell does not allow lower-case type constructors or upper case type variables. So, should varT, conT test and fall over? Or should we instead remove the distinction between varT and conT? Simon | -----Original Message----- | From: Wolfgang Thaller [mailto:wolfgang.thaller@gmx.net] | Sent: 30 October 2003 21:24 | To: Simon Peyton-Jones | Cc: <template-haskell@haskell.org> <template-haskell@haskell.org> | Subject: Re: [Template-haskell] RE: [ ghc-Bugs-820778 ] Malformed Predicate w/ Template Haskell | | > TH maestros | > | > This bug turns out to be simply that Template Haskell is only set up | > for | > Haskell 98, whereas Jon Cast wants to manipulate multi-parameter type | > clases. | > | > Should we add multi-param type classes to THSyntax? Does anyone feel | > like doing it? It's a fairly routine matter, but it does mean changing | > the data type. (Another reason to use bracket syntax!) | > | > Simon | | Hmmm... I've been using some simple multi-param type classes (no | fundeps) with Template Haskell and GHC from the STABLE cvs tree, and | I've experienced no problems, so I thought they were supported. | They *are* a very useful feature that I don't think I could do without | - what needs to be done to keep them at least as supported as they are | now? | | Cheers, | | Wolfgang |
participants (1)
-
Simon Peyton-Jones