[Template-haskell] Record constructors

Derek Elkins ddarius86@hotmail.com
Fri, 14 Feb 2003 14:35:28 -0500


>From: "Simon Peyton-Jones" <simonpj@microsoft.com>
>To: "Derek Elkins" <ddarius86@hotmail.com>,<template-haskell@haskell.org>
>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