About the Book
This book is based on a theory of why lenses are hard to learn:
- The canonical explanations were written by people suffering from the curse of knowledge: they know too much to understand what beginners don't know.
- 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.
- 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.
- 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.
About the Author
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.