package batteries

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val bind : ('a, 'e) t -> ('a -> ('c, 'e) t) -> ('c, 'e) t

Monadic composition.

bind r f proceeds as f x if r is Ok x, or returns r if r is an error.

  • since 2.0
val (>>=) : ('a, 'e) t -> ('a -> ('c, 'e) t) -> ('c, 'e) t

as bind

val return : 'a -> ('a, _) t

Monadic return, just encapsulates the given value with Ok