[Haskell-cafe] Some thoughts on Type-Directed Name Resolution

Paul R paul.r.ml at gmail.com
Thu Feb 9 10:58:54 CET 2012

Although it's a bit off topic, I must say I agree with Malcolm on that.
Record-fields-selection-as-functions might be sometime unconvenient, but
it is simple and easy to reason about and deal with, with usual Haskell
strategies (prefixed names, modules, qualified imports ... business as

However, records updating is often painful. A lot of thoughts have been
put in lenses, and they quiet improve the state of things. But,
franckly, having to pragma template haskell, then prefix all the fields
with an underscore, then call a TH splice straight in my code in not
a pleasure. Nor is a pleasure to hand-craft lenses. An improvement on
this front is probably easier to achieve, would make syntax more
consistent, and be immediatly applicable at large scale.

Malcolm> I very much fail to see the point of replacing prefix function
Malcolm> application with postfix dots, merely for field selection.
Malcolm> There are already some imperfect, but adequate, solutions to
Malcolm> the problem of global uniqueness of field names. But you now
Malcolm> have mentioned what is really bothering me about this
Malcolm> discussion: record updates are simply the most painful and
Malcolm> least beautiful part of the Haskell syntax. Their verbosity is
Malcolm> astonishing compared to the careful tenseness of every other
Malcolm> language construct. If we could spend some effort on designing
Malcolm> a decent notation for field updates, I think it would be
Malcolm> altogether more likely to garner support than fiddling with
Malcolm> dots.


More information about the Haskell-Cafe mailing list