Veit's Blog

Let’s Build Lenses in Carp


Today I want to try something a little bit different: I want to share a screencast with you! I’ve never done this, but I’ve always had a passion for live coding during my talks1, and I don’t feel like writing much at the moment.

The intended audience either knows a little bit about Carp or about lenses already. This talk assumes no prior knowledge, but it’s hard to learn multiple concepts at once. Of course you are welcome to watch it anyway, and I’d be happy to answer any and all questions you might have.

The video file is rather large, and I apologize for that. If you have any favorite screen recording tools on OS X, please tell me!

Download link


  1. Profunctor Optics: Modular Data Accessors by Matthew Pickering et al.: this is great if you want to learn the real theory behind lenses and prisms, and optics in general. It is not great if you don’t want to read 50 pages about that topic.
  2. Lenses embody Products, Prisms embody Sums by Justin Le: this blog post is a very detailed and deep dive into lenses and prisms, using Haskell as the vehicle. It explains why our implementation is theoretically unsound and how to rectify that. It is also more advanced than my screencast.


1. Maybe my real passion is angering the Gods?