Skip to content
HHackerTube.videoSurprise me

John Wiegley: Putting Lenses to Work

John Wiegley: Putting Lenses to Work on HackerTube: recommended by 4 Hacker News commenters across 4 separate months, 2020–2024.

Bay Area Haskell

talk · intermediate · evergreen

Open on YouTube

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.

Why Hacker News recommends it

HN recommends it as the fastest way to learn lenses by example, with far-out examples later on.

people recommended it
4
separate months
4
strong recommendations
2
discussed on HN
2020–2024
“you can learn enough lens to be productive in 1 hours with this talk without reading docs at all”
— platz, Jun 2020, in “Haskell for a New Decade [pdf]”

What HN commenters said

5 Hacker News comments link this video. Each one links back to its thread.

turboponyyJul 2024Strongly recommends

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

in “Ask HN: What resources do you recommend for learning Haskell?” · View on HN

platzJun 2020Strongly recommends

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

in “Haskell for a New Decade [pdf]” · View on HN

lgasNov 2022Recommends

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.

in “Ask HN: What piece of code/codebase blew your mind when you saw it?” · View on HN

ParetoOptimalJun 2022Recommends

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]

in “Dhall: A Gateway Drug to Haskell” · View on HN

ParetoOptimalJun 2022Recommends

> 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

in “Lenses” · View on HN

Topics & tags

Functional programminghaskelllensfunctional programmingbayhac