Expose infix viewing, replacement, mapping, and composition

This commit is contained in:
milner committed 2019-03-06 21:16:11 +00:00
1 parent a7237a6412
commit 59e39e593c
3 files changed
+24

No files matched your search

+8
View File
@@ -25,3 +25,11 @@ let _hd =
let _tl =
(fun source -> snd (split source)),
(fun tail source -> fst (split source) :: tail)
module Infix = struct
let ( ^. ) source focus = view focus source
let ( ^~ ) = set
let ( ^% ) focus f = over focus ~f
let ( ^> ) = compose
let ( ^< ) inner outer = compose outer inner
end