Haskell Language Lens Manipulating tuples with Lens

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Getting

("a", 1) ^. _1 -- returns "a"
("a", 1) ^. _2 -- returns 1

Setting

("a", 1) & _1 .~ "b" -- returns ("b", 1)

Modifying

("a", 1) & _2 %~ (+1) -- returns ("a", 2)

both Traversal

(1, 2) & both *~ 2 -- returns (2, 4)


Got any Haskell Language Question?