Imandra_prelude.OptionThe option type type 'a option = None | Some of 'a is useful for representing partial functions and optional values.
type 'a t = 'a optionMap over the option.
map f None = Nonemap f (Some x) = Some (f x)val map_or : default:'a -> ( 'b -> 'a ) -> 'b option -> 'aval is_some : 'a option -> boolReturns true iff the argument is of the form Some x
val is_none : 'a option -> boolReturns true iff the argument is None
val return : 'a -> 'a optionWrap a value into an option. return x = Some x
Monadic operator, useful for chaining multiple optional computations
Infix monadic operator, useful for chaining multiple optional computations together. It holds that (return x >>= f) = f x
Choice of a value
or_ ~else_:x None = xor_ ~else_:x (Some y) = Some yval exists : ( 'a -> bool ) -> 'a option -> boolval for_all : ( 'a -> bool ) -> 'a option -> boolval get_or : default:'a -> 'a option -> 'aval fold : ( 'a -> 'b -> 'a ) -> 'a -> 'b option -> 'a