3 ms·
> To my eye, the lenses code he ended up writing didn't look all that much prettier or shorter to me. I guess it's more neatly structured and could even be orga
by yakshaving_jgt 6y ago
> To my eye, the lenses code he ended up writing didn't look all that much prettier or shorter to me. I guess it's more neatly structured and could even be organized its own file?
I would typically shuffle all these lenses into their own file, yes.
It doesn't look shorter in the small example, but applied to a real-world example — given that lenses compose — the savings quickly begin to add up. The result (at least, in my experience) is that `update` functions are much shorter and easier to follow.