RE: [Template-haskell] Record constructors
From: "Simon Peyton-Jones"
To: "Derek Elkins" , Subject: RE: [Template-haskell] Record constructors Date: Fri, 14 Feb 2003 10:18:31 -0000 Good point. Indeed, THSyntax has no provision for record types and record expressions. Haskell is a pretty large language and I didn't cover the whole of it in the first pass, I'm afraid.
IAN L, would you care to put in the THSyntax for records contexts in data type declarations and add suitable stuff to DsMeta and Convert to get them to and fro?
(Or someone else!) I'm too much of a bottleneck for stuff like this. I'm inclined to focus my time on things where it really has to be me.
Simon
Okay. I'll take a swing at it. I've made all the changes I think are necessary for contexts on datatypes, but I won't know until I recompile. For record constructors, I'm thinking of adding `RecConstr String [(String, Typ)]` to Con in THSyntax. This is slightly modified from the HsSyn version `HsRecDecl SrcLoc HsName [([HsName],HsBangType)]` which I suppose is setup to handle `foo,bar :: a -> b` I don't see this as very convenient for generation or reification. So unless I'm missing something or another layout is preferable, that's the setup I'm going with. _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail
On Fri, Feb 14, 2003 at 02:35:28PM -0500, Derek Elkins wrote:
From: "Simon Peyton-Jones"
To: "Derek Elkins" , Subject: RE: [Template-haskell] Record constructors Date: Fri, 14 Feb 2003 10:18:31 -0000 Good point. Indeed, THSyntax has no provision for record types and record expressions. Haskell is a pretty large language and I didn't cover the whole of it in the first pass, I'm afraid.
IAN L, would you care to put in the THSyntax for records contexts in data type declarations and add suitable stuff to DsMeta and Convert to get them to and fro?
(Or someone else!) I'm too much of a bottleneck for stuff like this. I'm inclined to focus my time on things where it really has to be me.
Simon
Okay. I'll take a swing at it.
OK - if you have problems I will try to help. Is there a reason why strictness annotations are ignored, or just the first pass issue again? Presumably any StrictnessMark except NotMarkedStrict should be reported as strict? I think data Con = Constr String [(Strictness, Typ)] data Strictness = Strict | NonStrict is probably as good a representation as any other. Any objections? Thanks Ian
participants (2)
-
Derek Elkins -
Ian Lynagh