Lenses for the Mere Mortal… by Brian Marick [PDF/iPad/Kindle]
Lenses for the Mere Mortal: PureScript Edition
Lenses for the Mere Mortal: PureScript Edition
Lenses for the Mere Mortal: PureScript Edition

Last updated on 2018-03-19

About the Book

This book is based on a theory of why lenses are hard to learn:

  1. The canonical explanations were written by people suffering from the curse of knowledge: they know too much to understand what beginners don't know.
  2. The implementation of lenses is immensely clever and perhaps even profound. That's completely irrelevant to beginners, but explanations by people excited by the implementation "infect" explanations for beginners. Beginners do not need to care about those fundamentals until fairly late in their learning.
  3. The reference implementation of lenses uses operators very heavily. Although there are named functions behind those operators, the operators dominate beginner documentation. That means that an understanding task is coupled with a memorization task. Many people (me!) are not good at memorization.
  4. The documentation is too scattered. There's no clear through line for beginners to follow, no path that doesn't threaten to suddenly dump the beginner into depths they're not ready to handle.

This book aims to address those problems. It uses a PureScript version of lenses because I happen to be learning PureScript these days. It's probably still useful for people wanting to learn the Haskell version of lenses.

I assume only shallow knowledge of PureScript, roughly equivalent to the three post-Elm introductory chapters in An Outsider's Guide to Statically Typed Functional Programming (not yet published as of March 8 2018, but they will be included in that book's free sample when published.)

About the Author

Brian Marick
Brian Marick

Brian Marick was first exposed to the functional style in 1983, when the accident of knowing a little bit of Lisp tossed him into the job of technical lead on a project to port Common Lisp to a now-defunct computer architecture. That led him to a reading spree about all things Lisp, the language from which the functional style arguably originated. He’s been a language geek ever since, despite making most of his living as a software process consultant. He’s the author of the popular Midje testing library for Clojure and has written books (Everyday Scripting with Ruby, Programming Cocoa with Ruby, and Functional Programming for the Object-Oriented Programmer). The two books in progress are An Outsider's Guide to Statically Typed Functional Programming and Lenses for the Mere Mortal.

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors and publishers use Leanpub to publish amazing in-progress and completed ebooks, just like this one. You can use Leanpub to write, publish and sell your book as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub