StackOverflow 文档 Haskell Language 教程 镜片 用镜头操作元组 用镜头操作元组 Created: November-22, 2018 入门 ("a", 1) ^. _1 -- returns "a" ("a", 1) ^. _2 -- returns 1 设置 ("a", 1) & _1 .~ "b" -- returns ("b", 1) 修改 ("a", 1) & _2 %~ (+1) -- returns ("a", 2) both Traversal (1, 2) & both *~ 2 -- returns (2, 4) 镜头和棱镜记录镜头