What is it?
Example code for “Lenses: Fields as Values”, my intro talk on functional lenses in Scala. Includes code for hand-rolled lenses as well as automatically generated ones using Shapeless and Rillit.
It's 2015 now. Is this still current?
Yes and no.
Yes because the talk is still a good introduction to what lenses are. I wouldn't change anything about the standalone lens code.
No because the details about third party libraries are now obsolete. Shapeless has changed a lot, Rillit seems abandoned, and lots of competition has sprung up such as the actively maintained Monocle and Quicklens. (There's also Sauron, which at 50 lines of source looks like a good learning tool.)
When & where was the talk given?
- June 2013 at Scala Days (details)
- January 2013 for Chicago-Area Scala Enthusiasts (details)
- November 2012 for Boston Scala Enthusiasts (details)
- July 2012 at Scalathon in Philadelphia
Unlike earlier versions, the June 2013 version includes coverage of the lens generator Rillit.
How to run
% git clone https://github.com/SethTisue/lens-examples
% cd lens-examples
% ./sbt
> test
...
> console
...
Slides
Google docs link (June 2013 version)
Video
June 2013 version (June 2013 version; 45 minutes; audio and slides only, no video of me)
November 2012 version (November 2012 version; 65 minutes)
License
http://creativecommons.org/publicdomain/zero/1.0/
To the extent possible under law, Seth Tisue has waived all copyright and related or neighboring rights to the contents of https://github.com/SethTisue/lens-examples/. This work is published from the United States of America.