Slides for Introduction
Opened this issue · 4 comments
joshcho commented
This might not be the right place (feel free to close). But I am just learning about Lens, and the laws on the first slide of introductory slides were quite confusing (i.e. types don't match for the first law) . I ended up looking around and noticing this blog which corrects the first law.
If I am not mistaken, this could be a huge turn-off for beginners, especially if Lenses are known to be difficult.
EDIT: third -> first
phadej commented
the slides have
set :: Lens s a -> s -> a -> s
my post has both,btw.
set l v' (set l v s) ≡ set l v' s -- without type of set stated, but probably set :: Lens s a -> a -> s -> s
set (set s a) a' ≡ set s a' -- using set :: Lens s a -> s -> a -> s
joshcho commented
I guess I mean the first law here then. The slides have:
set l (view l s) s = s
This doesn't quite make sense to me. Shouldn't it be:
set l s (view l s) = s
since (view l s)
returns the element a
.
phadej commented
ekmett commented
I'll hunt around for them.