Monadic DSL (based on function builders)

In F#'s compute expressions, monadic bindings are decorated differently from regular bindings; they use let* for bindings that unwrap a value into the following scope. Ocaml adopted let* as well and also introduced let+ for applicative rather than monadic bindings. Maybe we could support buildUnwrappedBinding(value: M<T>, in body: (T) -> M<U>) as a function builder method for explicit unwrapped bindings in the future, though as you note, that would require us to CPS or coroutine-ify the built body.

11 Likes