* **Left identity: unit is a left identity for the bind operation.**
That is, for all `f:'a -> 'a m`, where `'a m` is a monadic
- type, we have `(unit x) * f == f x`. For instance, `unit` is itself
+ type, we have `(unit x) >>= f == f x`. For instance, `unit` is itself
a function of type `'a -> 'a m`, so we can use it for `f`:
# let unit x = Some x;;
The parentheses is the magic for telling OCaml that the
function to be defined (in this case, the name of the function
- is `*`, pronounced "bind") is an infix operator, so we write
- `u * f` or `( * ) u f` instead of `* u f`. Now:
+ is `>>=`, pronounced "bind") is an infix operator, so we write
+ `u >>= f` or equivalently `( >>= ) u f` instead of `>>= u f`. Now:
# unit 2;;
- : int option = Some 2