Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on Nov 27, 2012
Lenses aren't in the Scala standard library, but two libraries provide them: Scalaz and Miles Sabin's Shapeless. Seth will show how you to use the Shapeless version, and we'll look at how it's implemented.
A lens represents a readable and "settable" location in a possibly nested immutable object. ("Settable" is in quotes because we make a new object rather than mutating the old one.)
This may interest you if:
...you use immutable objects
...you use nested immutable objects
...you want to abstract over different fields in your immutable objects
...you're interested in functional programming
This will overlap a lot with Ed Kmett's 2011 talk on the same subject. If you saw and completely grasped Ed's talk, you might not learn much from this one. Compared to Ed's, Seth's take will be more elementary and less formal. (And I'll be covering only lenses themselves, not bringing in the state monad too.)