Records in Haskell

Gershom Bazerman gershomb at gmail.com
Sat Dec 31 20:12:14 CET 2011


On Dec 31, 2011, at 1:28 PM, Simon Peyton-Jones wrote:
> The trouble is that I just don't have the bandwidth (or, if I'm honest, the motivation) to drive this through to a conclusion. And if no one else does either, perhaps it isn't *that* important to anyone.  That said, it clearly is *somewhat* important to a lot of people, so doing nothing isn't very satisfactory either.
> 
> Usually I feel I know how to move forward, but here I don't.
> 
> Simon
> 

It seems to me that there's only one essential missing language feature, which is appropriately-kinded type-level strings (and, ideally, the ability to reflect these strings back down to the value level). Given that, template haskell, and the HList bag of tricks, I'm confident that  a fair number of elegant records packages can be crafted. Based on that experience, we can then decide what syntactic sugar would be useful to elide the TH layer altogether.

Beyond that, it would really help namespacing in general to appropriately extend the module system to allow multiple modules to be declared within a single file -- or, better yet, "submodules". I know that this introduces a few corner cases that need to be thought through -- what happens with overlapping declarations, for example. But I tend to think the path here is relatively straightforward and obvious, and the added expressive power should make namespacing issues much more tractable. Like the type-level strings proposal, this isn't about implementing records as such -- rather, it's about generally extending the expressive power of the language so that record systems--among other things--are easier to write.

Cheers,
Gershom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20111231/8457ae5d/attachment-0001.htm>


More information about the Glasgow-haskell-users mailing list