Frama-C API - S_with_product
Monad signature with product
In a computational point of view, a monad is an abstraction of a sequence of operations. But sometimes, one may need to specify that two operations can be performed in *any* order, for instance when dealing with concurrency or generic errors handling using the option type. To do so, one needs a *product* on monadic values, i.e a way to combine two monads into a new one. Thus a second signature is provided, including a product operator and the two let-bindings and* and and+.
val return : 'a -> 'a tmodule Bool : sig ... endmodule Option : sig ... endmodule List : sig ... endmodule Operators : sig ... end