package sugar

  1. Overview
  2. Docs
val (>>|) : 'a result -> ('a -> 'b) -> 'b result
val (<$>) : ('a -> 'b) -> 'a result -> 'b result

Applicative combinator for map

val (<*>) : ('a -> 'b) result -> 'a result -> 'b result

Applicative combinator for parallel execution of function and operand

val (>>>=) : 'a UserMonad.t -> ('a -> 'b UserMonad.t) -> 'b UserMonad.t

An alias for UserMonad.(>>=)

This combinator provides direct access to the monad used to create this module.

val (>---------) : 'a result -> (error -> 'a result) -> 'a result

"Broom" combinator

This is an alias for the function bind_unless. It provides syntatic sugar to create error handlers in a more intuitive way.

There's a secret message behind the form of this combinator. It has the same number of characters sufficient for the whole block in the next line. For example:

let program1 () =
  do_something ()
  >---------
  ( fun e ->
    return ()
  )

let program2 () =
  do_something ()
  >---------
  ( function
    e -> return ()
  )
val (>>) : unit result -> 'b result Lazy.t -> 'b result
val (>>>) : 'a result -> 'b result Lazy.t -> 'b result
OCaml

Innovation. Community. Security.