tablecloth
tablecloth copied to clipboard
Add Option.thenAlso
Sample implemenetation
(* If a is some, then apply fn to a, return both a and the result.
if either a or b is none, then return none
*)
let thenAlso (a : 'a option) ~(f : 'a -> 'b option) : ('a * 'b) option =
let b = andThen ~f a in
pair a b