Slides: comonad.com/has...
This was a talk I gave at the second New York Haskell User Group Meeting (www.meetup.com/...) on the new lens library, which provides a highly composable toolbox for accessing and modifying multiple parts of data structures.
Starting with building blocks such as fmap and (.), we build up combinators suitable for working with a wide array of data structures. These generalize the notions you already know how to use into a form that is easier to compose and simultaneously allow them to be used for monomorphic containers such as Data.Text.
All without compromising on your ability to reason about them using laws!
Finally, once I've built up some foundations, I do a bit of a deep dive, exploring consequences of this design. In particular we discuss the efficient generic programming programming framework exported by lens, and type-safe Traversal-based zippers.
Familiarity with the Applicative and Traversable classes from the Haskell base libraries will be helpful (links provided below), but a basic understanding of the concepts get introduced as I go along.
Useful (but not mandatory) references:
The lens library and documentation: hackage.haskell...
A previous, more introductory talk on how to use the lenses Edward Kmett wrote for the scalaz in the Scala programming language: • Lenses: A Functional I...
The original Applicative paper: www.soi.city.ac...
Lots of information on Traversable: www.cs.ox.ac.uk...
A write-up of this talk, as presented at the Bay Area Haskell Users Group: google-opensour...
The original Keynote version of the slides are available from comonad.com/has...
Thanks go to Johan Kiviniemi, who worked magic when it came to cleaning up the audio for this recording!
Негізгі бет Lenses, Folds, and Traversals
No video
Пікірлер: 38