[Haskell-cafe] Status of TypeDirectedNameResolution proposal?

Levi Greenspan greenspan.levi at googlemail.com
Tue Nov 17 09:36:52 EST 2009

On Tue, Nov 17, 2009 at 1:18 PM, Simon Peyton-Jones
<simonpj at microsoft.com> wrote:
> | What's the status of the TDNR proposal [1]? Personally I think it is a
> | very good idea and I'd like to see it in Haskell'/GHC rather sooner
> | than later. Working around the limitations of the current record
> | system is one of my biggest pain points in Haskell and TDNR would be a
> | major improvement. Thus I wonder if someone is actively working on
> | this proposal?
> It's stalled.  As far as I know, there's been very little discussion about it.  It's not a trivial thing to implement, and it treads on delicate territory (how "." is treated).  So I'd need to be convinced there was a strong constituency who really wanted it before adding it.

Well, implementing certain protocols (e.g. based on JSON, like Bayeux
[1]) in a type-safe way requires lots of records and many of these
records have similar selectors, e.g. channel. Currently one can only
have a nice interface to such a protocol by using type classes and
creating lots of instance declarations, which is a lot of boilerplate
to be written. This would be much easier with TDNR, than with
module-scoped record selectors. Also the hack to use different modules
is further complicated by the fact that at least GHC insists on having
each module in a separate file.

As pointed out by others one may choose a different string instead of
"." like "->"  if this makes the implementation of TDNR feasible. But
some mechanism to have some sort of scoped record selectors or TDNR is
needed in my opinion.

Many thanks,

[1] http://svn.cometd.org/trunk/bayeux/bayeux.html

> I've added an informal straw poll to the bottom of [1] to allow you to express an opinion.
> Also I'm not very happy with the "stacking operations" part, and I'd like a better idea.
> Simon

More information about the Haskell-Cafe mailing list