Add polymorphic tuple projections and replacements

This commit is contained in:
milner committed 2019-02-22 15:45:12 +00:00
1 parent d996eba971
commit 28d28de6fa
3 files changed
+10

No files matched your search

+5
View File
@@ -20,3 +20,8 @@ let () =
let focus = compose first second in
assert (view focus ((true, "grey"), false) = "grey");
assert (set focus 9 ((true, "grey"), false) = ((true, 9), false))
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")