[Haskell-cafe] Representation of lenses

Charles Durham ratzes at gmail.com
Wed Jan 28 14:33:11 UTC 2015


glad that helped, definitely helped me

On Tue, Jan 27, 2015 at 3:29 PM, David Turner <dct25-561bs at mythic-beasts.com
> wrote:

> On 27 January 2015 at 17:23, Charles Durham <ratzes at gmail.com> wrote:
> > You need to sign up for it, but this is a phenomenal talk by simon peyton
> > jones describing the idea behind lenses the way he understood it.
> >
> >
> https://skillsmatter.com/skillscasts/4251-lenses-compositional-data-access-and-manipulation
>
> Thanks, I think that was exactly what I needed to know.
>
> If I understand the key section right, you can do all that stuff with
> a straight get/set pair but it'd be desperately inefficient, so then
> you add an update function, and then one at Maybe and [] and IO and
> they all start to look the same so you generalise to all Functors, and
> then you discover that using Const you get a getter, and Identity
> gives you a setter, so you can throw them away and end up with a lens
> as we know it.
>
> And then you generalise it in about a billion other directions and you
> end up with the lens library!
>
> Much obliged,
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150128/e0652518/attachment.html>


More information about the Haskell-Cafe mailing list