So called "let operators" are now supported in OCaml, however I was wondering if a default implementation of let*
and and*
, for monads, are shipped with the standard library in a module somewhere?
They are not defined directly, but you can "import" them as:
let (let*) = Option.bind
let editor_home =
let* home = Sys.getenv_opt "HOME" in
let* editor = Sys.getenv_opt "EDITOR" in
Some (editor ^ " " ^ home)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With