Lenses, Folds, and Traversals

Slides: http://comonad.com/haskell/Lenses-Folds-and-Traversals-NYC.pdf This was a talk I gave at the second New York Haskell User Group Meeting (http://www.meetup.com/NY-Haskell/) 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: http://hackage.haskell.org/package/lens A previous, more introductory talk on how to use the lenses Edward Kmett wrote for the scalaz in the Scala programming language: https://www.youtube.com/watch?v=efv0SQNde5Q The original Applicative paper: http://www.soi.city.ac.uk/~ross/papers/Applicative.pdf Lots of information on Traversable: http://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf A write-up of this talk, as presented at the Bay Area Haskell Users Group: http://google-opensource.blogspot.com/2012/10/lenses-folds-and-traversals-haskell.html The original Keynote version of the slides are available from http://comonad.com/haskell/Lenses-Folds-and-Traversals-NYC.key Thanks go to Johan Kiviniemi, who worked magic when it came to cleaning up the audio for this recording!

Related Talks

"Writing a game in Haskell" by Elise Huard

"Writing a game in Haskell" by Elise HuardHaskell is a beautiful functional language, written by smart computer scientists, and having clever and elegant functional constructs. It clearly separates pure and impure parts of the program. Game programming on the other hand is a very hands-on discipline, trying to wring out the most of the machine's performance, and aiming ...

Functional Programming; What? Why? When?

"Uncle Bob" - Robert Cecil Martin
an hour
Functional Programming; What? Why? When?Why is functional programming becoming such a hot topic? Just what _is_ functional programming anyway? And when am I going to have to know about it? In this talk Uncle Bob will walk you through the rationale that is driving the current push towards functional programming. He'll also introduce you ...

Rishiyur S. Nikhil - Enigmatic Haskell, Haskellish Enigma

an hour
Rishiyur S. Nikhil - Enigmatic Haskell, Haskellish EnigmaBoston Haskell, February 18, 2015 Nikhil builds an Enigma machine. First in Cryptol, then in hardware by way of Haskell. Slides and code available here: https://github.com/rsnikhil/Enigma_Cryptol_Bluespec_BSV.git ...

The Functional Final Frontier

David Nolen
27 minutes
The Functional Final FrontierThe Model-View-Controller (MVC) approach to user interfaces was first proposed by Trygve Reenskaug in a 1979 Xerox PARC note. As Object Oriented methodologies gained popularity, MVC too gained traction as a natural and logical way to construct user interfaces despite obvious shortcomings. Even though OO researchers moved forward with alternative ...

Kenneth Foner - Getting a Quick Fix on Comonads

an hour
Kenneth Foner - Getting a Quick Fix on ComonadsKenneth Foner's Comonad talk at the Boston Haskell meetup, September 17, 2014. Code and slides: https://github.com/kwf/ComonadSheet ...

Dan Doel - Introduction to Low Level Haskell Optimization

an hour
Dan Doel - Introduction to Low Level Haskell OptimizationDan Doel's talk at the Boston Haskell Meetup, Sept 17, 2014 Slides: https://drive.google.com/file/d/0B8Kkr1O1jFwcRmhxbzBMR1Ntb3c/edit?usp=sharing ...

Lambda Calculus Then and Now

Lambda Calculus Then and NowTalk by ACM A.M. Turing Laureate Dana S. Scott during the ACM A.M. Turing Centenary Celebration, June, 2012. Abstract: A very fast development in the early 1930s, following Hilbert's codification of Mathematical Logic, led to the Incompleteness Theorems, Computable Functions, Undecidability Theorems, and the general formulation of recursive Function Theory. The so-called ...

Cody Roux - Pure Type Systems

an hour
Cody Roux - Pure Type SystemsCody Roux's talk for the Boston Haskell Meetup - February 18, 2015 Slides: http://www.slideshare.net/imalsogreg/cody-roux-pure-type-systems-boston-haskell-meetup ...

Brian Beckman: Don't fear the Monad

Brian Beckman: Don't fear the MonadCross posted from msdn's channel 9. Functional programming is increasing in popularity these days given the inherent problems with shared mutable state that is rife in the imperative world. As we march on to a world of multi and many-core chipsets, software engineering must evolve to better equip software engineers with ...