Source file either.ml

1
2
3
4
5
6
7
8
type ('a, 'b) t =
  | Left  of 'a
  | Right of 'b

let map t ~l ~r =
  match t with
  | Left x -> l x
  | Right x -> r x