News for hackers. Stuff that matters.
Re:Why Isn’t Programming Futuristic? by jhickner on Thursday October 24, 2013 @04:00AM (#6603900)
Does lens have a succinct way to traverse a nested data structure where each node is a maybe?

Lenses + Prisms (nicest way I know of in lens):

nested ^? foo . _Just . bar . _Just . baz . _Just

vs. the Maybe monad:

foo >=> bar >=> baz $ nested

Re:Why Isn’t Programming Futuristic? by tel on Thursday October 24, 2013 @07:30AM (#6604585)
That's the nicest I know as well. You could use `mapped` instead of `_Just` to make it more generic

    nested ^? foo . mapped . bar . mapped . baz . mapped
Which is also a bit closer to the nature of `>=>` chaining. I actually really like the _Just descent since it makes some of the failure modes for this lens very explicit.

And then it should always be said that the lens has setter properties that the `>=>` chain does not.

Re:Why Isn’t Programming Futuristic? by mercurial on Thursday October 24, 2013 @04:12AM (#6603939)
I think that's basically it. You can check out a great example of prisms in the lens-aeson article on FPComplete:

https://www.fpcomplete.com/user/tel/lens-aeson-traversals-pr...