[Template-haskell] generation of type signatures for Accessors

Nicolas Pouillard nicolas.pouillard at gmail.com
Tue Mar 24 18:26:14 EDT 2009


Excerpts from brian's message of Tue Mar 24 18:22:17 +0100 2009:
> On Tuesday, 24.03.09 at 09:45, Nicolas Pouillard wrote:
> > Excerpts from brian's message of Tue Mar 24 03:22:51 +0100 2009:
> > > Hey, I'm trying to modify data-accessor-template 'deriveAccessors' to
> > > generate type signatures so -Wall doesn't complain.
> > 
> > You should look at data-accessor-template-0.2.1 for solution then ;)
> 
> Well, Henning released 0.2.1 because of the patch I sent him. Various
> projects are breaking right now because I didn't know about the
> parameterized records thing. That's why I'm asking on the list.

Ooops, I could have said something more useful then :)

Basically one have to ask for the parameters of the type (`a' here).
One then have to use these parameters to build a fully applied type
(`P a' here), finally one must bind those type variables using a
universal quantification (`forall a.' here).

I attach a darcs patch that does exactly this. However I've only
tested a few test cases.

PS: I've put Henning in copy of this message.

-- 
Nicolas Pouillard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generate-valid-signatures-for-accessor-in-presence-of-parameterized-types_.dpatch
Type: application/octet-stream
Size: 4239 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/template-haskell/attachments/20090324/89cc8cdb/generate-valid-signatures-for-accessor-in-presence-of-parameterized-types_.obj


More information about the template-haskell mailing list