Getting acquainted with Lens
summary
Shows that Haskell records are painful and demonstrates using the Lens library to read and update nested fields without boilerplate, using examples: a Conference with Organizer and Speakers, setting organizer.contact.email and flipping every speaker’s slidesReady to False. Uses operators view, set and %~ (over) and composition with (.) and (&). Compares generation with makeLenses (Template Haskell) vs generics-lens + overloaded labels for duplicate field names. Explains Traversal for lists and the implementation trick choosing Const/Identity functors to implement view/over/set — and it works.
AI-written summary · about
