diff options
author | 2014-11-18 11:02:17 +0100 | |
---|---|---|
committer | 2014-11-19 18:52:13 +0100 | |
commit | d846451c9a07b4e051173878a5446edea029bf5b (patch) | |
tree | 0e8920a1174b268b6268d5615ffa5941bae3daa7 /lib/util.ml | |
parent | 36c2559cefb54dc503fea375d15d3224992f6221 (diff) |
Making map_union a standard function of the ML library.
Diffstat (limited to 'lib/util.ml')
-rw-r--r-- | lib/util.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml index 16b5f4615..531e4fe7d 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -124,3 +124,7 @@ let delayed_force f = f () type ('a, 'b) union = ('a, 'b) CSig.union = Inl of 'a | Inr of 'b type 'a until = 'a CSig.until = Stop of 'a | Cont of 'a + +let map_union f g = function + | Inl a -> Inl (f a) + | Inr b -> Inr (g b) |