package containers

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val (>|=) : ('a, 'err) t -> ('a -> 'b) -> ('b, 'err) t
val (>>=) : ('a, 'err) t -> ('a -> ('b, 'err) t) -> ('b, 'err) t

Monadic composition. e >>= f proceeds as f x if e is Ok x or returns e if e is an Error.

val (<*>) : ('a -> 'b, 'err) t -> ('a, 'err) t -> ('b, 'err) t

a <*> b evaluates a and b, and, in case of success, returns Ok (a b). Otherwise, it fails, and the error of a is chosen over the error of b if both fail.

Let operators on OCaml >= 4.08.0, nothing otherwise

  • since 2.8
include CCShimsMkLet_.S2 with type ('a, 'e) t_let2 := ('a, 'e) result
val let+ : ('a, 'e) result -> ('a -> 'b) -> ('b, 'e) result
val and+ : ('a, 'e) result -> ('b, 'e) result -> ('a * 'b, 'e) result
val let* : ('a, 'e) result -> ('a -> ('b, 'e) result) -> ('b, 'e) result
val and* : ('a, 'e) result -> ('b, 'e) result -> ('a * 'b, 'e) result
OCaml

Innovation. Community. Security.