Better Records was Re: [Haskell-cafe] Type Directed Name Resolution

John Lask jvlask at
Thu Nov 11 18:48:06 EST 2010

 > If the outcome of this discussion is a clamour for better records
 > instead of TDNR, then that would certainly make me happy.
 > Regards,
 > Malcolm

well I certainly am clamouring for better records.

This motivated my original reply this post. The trouble is, what
constitutes better records? There are as many views as users of Haskell, 
I bet.

My main motivation is:

As mentioned in my original post: better name space management.

Surprisingly enough, I find the current record system is quite usable, 
bar one feature. My particular use case: commercial applications make 
heavy use of records (in connection with relational databases) and name 
clashes are inevitable.

As I tried to point out in my original post, issues of name space 
management are orthogonal to the type system, but obviously related as 
the type system in Haskell is used to distinguish names.

The thrust of discussion and work on the record system, in so far as 
Haskell has been concerned, has been at the type system level, an 
necessarily so: work on representing the "has a" relation, extensibility 
etc at the type level. Some relatively usable libraries have been 
developed that provide this support (eg HList).

none of this can address my particular issue: name space management, 
that is, managing the scope of record labels. The type system is not the 
solution to all problems. Hence my proposal.

I don't envisage that my issue will be addressed anytime soon, if at 
all. But by raising it I hope to broaden the focus of the discussion.

The trouble with any rework of the current record system: which way to 
take it ... the design space is large

what would users want ...

- light weight records (c.f. ML)
- first class labels (accessors and setters)
- extensible records
- sub-typing

or in my case

- better name space management

perhaps given the many avenues for exploration of type system support 
for record systems, we could make use of existing libraries with 
rebind-able syntax??

again quoting

"Haskell lacks a serious record system. (The existing mechanism for 
named fields in data types was always seen as a stop-gap measure.)"

isn't it about time this changed?

> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at

More information about the Haskell-Cafe mailing list