3 ms·
If you apply `_1` to `set` then it specializes to `set _1 :: a -> (a, b) -> (a, b)`. Yes its confusing. It sometimes helps to give longer variables: _1 ::
by solomonb 4y ago
If you apply `_1` to `set` then it specializes to `set _1 :: a -> (a, b) -> (a, b)`.
Yes its confusing. It sometimes helps to give longer variables:
_1 :: Lens' (fst, snd) fst
set :: Lens' structure focus -> focus -> structure -> structure
set _1 :: fst -> (fst, snd) -> (fst, snd)
You are bumping up against the severe amount of polymorphism at play in the lens library. This makes it hard to build a mental model but is a tremendous source of expressiveness and utility.