
On Thu, Jun 27, 2013 at 2:14 AM, AntC
Does the lens approach meet SPJ's criteria of: * It is the smallest increment I can come up with that meaningfully addresses the #1 pain point (the inability to re-use the same field name in different records).
* It is backward-compatible.
It's difficult to get more backward compatible than "is already working, without any changes to the compiler or standard libraries at all". Note in particular that (.) is not redefined or changed. I think the only pain point is code that itself defines (^.) or functions beginning with an underscore. As for reusing the same field in different records, the point of lens is it's a generic accessor/mutator mechanism. It doesn't just support different records, it supports different pretty much everything — no significant difference between a record, a tuple, a list, a Map, .... And it composes very well, so it's absurdly easy to drill down into a complex nested structure. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net