News for hackers. Stuff that matters.
Re:Dhall: A Gateway Drug to Haskell by solomonb on Wednesday June 08, 2022 @12:01AM (#31663039)
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.

There are no comments on this comment yet.