partial : exn -> ('a -> 'b option) -> 'a -> 'b
The function partial has an inverse total. Generally speaking, (partial err o total) f equals f, provided that err is the only exception that f raises. Similarly, (total o partial err) f is equal to f.
- Int.fromString "foo"; > val it = NONE : int option - partial (Fail "not convertable") Int.fromString "foo"; ! Uncaught exception: ! Fail "not convertable" - (total o partial (Fail "not convertable")) Int.fromString "foo"; > val it = NONE : int option