John Wiegley: Putting Lenses to Work
Bay Area Haskell4 HN recommenders · recommended in 4 months, 2020–2024
talk · intermediate · evergreen · 2020–2024 on HN
John Wiegley's BayHac 2017 talk walks through Haskell lenses by example, showing many practical uses beyond simple record access. It is aimed at people who want to become productive with the lens library.
HN recommends it as the fastest way to learn lenses by example, with far-out examples later on.
Up next
4 mo on HNGabriella Gonzalez – How to market Haskell to a mainstream programmer
Konfy
2 HN recommender · 2020–2023
4 mo on HNBlack hole Firewalls - with Sean Carroll and Jennifer Ouellette
The Royal Institution
3 HN recommender · 2017–2022
4 mo on HNFour Solutions to a Trivial Problem - Guy Steele Jr.
Google TechTalks
4 HN recommender · 2017–2023
5 mo on HNLeonard Susskind on The World As Hologram | TVO Docs
TVO Docs
7 HN recommender · 2013–2021
5 mo on HN"Controlling Time and Space: understanding the many formulations of FRP" by Evan Czaplicki
Strange Loop Conference
5 HN recommender · 2014–2026
3 mo on HNYanis Varoufakis: The Global Minotaur: America, Europe and the Future of the Global Economy
SkriptaTV
3 HN recommender · 2015–2015
4 mo on HN"Finding bugs without running or even looking at code" by Jay Parlar
Strange Loop Conference
4 HN recommender · 2019–2023
3 mo on HNEmacs From Scratch #1 - Getting Started with a Basic Usable Configuration
System Crafters
3 HN recommender · 2021–2024
18 mo on HNRuby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich
Confreaks
17 HN recommender · 2013–2026
14 mo on HNThe Soul of Erlang and Elixir • Sasa Juric • GOTO 2019
GOTO Conferences
16 HN recommender · 2019–2024
14 mo on HN"Simple Made Easy" - Rich Hickey (2011)
Strange Loop Conference
14 HN recommender · 2022–2026
13 mo on HN"Making Impossible States Impossible" by Richard Feldman
elm-conf
9 HN recommender · 2017–2026
5 comments from Hacker News
As with anything Haskell, one could simply reply with "here's the formal definition." But in easily digestible terms, it's a way to narrow your view over a collection to a subset that satisfies some property, and perhaps perform some operations on that subset. This video presentation (with a very humorous audience dynamic, might I add) serves as a great introduction by example: ▶ this video
and you can learn enough lens to be productive in 1 hours with this talk without reading docs at all. You can skip the theory and go straight to usage: ▶ this video
Definitely agree on lenses being one of the more mind blowing things I've encountered and eventually grokked in programming. I would also recommend ▶ this video as a good video on lenses in part because the latter portion has some pretty far-out examples of that deep well you mentioned.
Good examples in "Putting lenses to work" by John Weigley: ▶ this video Then for a great book that gives a great understanding see Chris Penner's amazing and fun "Optics by example: link
> Lenses let you do some amazing things, but I think most of their existence is just thanks to how truly horrible (nested) record field access and updates were. Only for the most basic uses. Architecting programs as folds or traversals can be powerful. One simple example of lenses i can think of being useful for more than record access is: > sumOf (folded . folded) [Just 1, Just 2] 3 More are in this presentation: ▶ this video