[Haskell-cafe] What Haskell Records Need

Erik Hesselink hesselink at gmail.com
Thu Aug 2 12:41:16 CEST 2012

On Thu, Aug 2, 2012 at 12:30 PM, Andrew Butterfield
<Andrew.Butterfield at scss.tcd.ie> wrote:
> On 2 Aug 2012, at 09:25, Erik Hesselink wrote:
>> Isn't this exactly the problem solved by all the lens packages?
>> Current popular ones are fclabels [0] and data-lens [1].
>> [0] http://hackage.haskell.org/package/fclabels
>> [1] http://hackage.haskell.org/package/data-lens
> Not sure what all of these do, but I have a simple solution I use
> in my work:

They do exactly that. They create 'lenses' which are
getters/setters/modifiers combined, and allow you to compose these to
get/set/modify deep inside nested data types. Look at the examples in
the fclabels documentation [2] for more details.

[2] http://hackage.haskell.org/packages/archive/fclabels/1.1.4/doc/html/Data-Label.html

More information about the Haskell-Cafe mailing list