total : ('a -> 'b) -> 'a -> 'b option
The function total has an inverse partial. 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.
- 3 div 0; ! Uncaught exception: ! Div - total (op div) (3,0); > val it = NONE : int option - (partial Div o total) (op div) (3,0); ! Uncaught exception: ! Div