Provide the identity lens and verify composition identities

This commit is contained in:
sneeker committed 2019-02-24 07:41:34 +00:00
1 parent 0377c2f0f4
commit adc5d38b9b
3 files changed
+7

No files matched your search

+5
View File
@@ -25,3 +25,8 @@ let () =
assert (set _1 "grey" (1, true) = ("grey", true));
assert (over _2 ~f:string_of_int (false, 9) = (false, "9"));
assert (view (compose _1 _2) ((true, "grey"), ()) = "grey")
let () =
assert (set _id "grey" 9 = "grey");
assert (view (compose _id _1) (9, false) = view _1 (9, false));
assert (set (compose _2 _id) "grey" (true, 9) = set _2 "grey" (true, 9))