package containers

  1. Overview
  2. Docs
A modular, clean and powerful extension of the OCaml standard library

Install

Dune Dependency

Authors

Maintainers

Sources

v3.2.tar.gz
md5=14787fb6878a94dd728a0ef7e368ab89
sha512=9debbd79542fbe24e6b0ec5e0fb74077566663fa53b868aa381962653d65543a86606ed6703a75cf3e14962b66068747b237a88bb1eea15b6062665e294795ac

doc/containers/CCResult/Infix/index.html

Module CCResult.InfixSource

Sourceval (<$>) : ('a -> 'b) -> ('a, 'err) t -> ('b, 'err) t

Infix version of map.

  • since 3.0
Sourceval (>|=) : ('a, 'err) t -> ('a -> 'b) -> ('b, 'err) t

Infix version of map with reversed arguments.

Sourceval (>>=) : ('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.

Sourceval (<*>) : ('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
Sourceval (let+) : ('a, 'e) result -> ('a -> 'b) -> ('b, 'e) result
Sourceval (and+) : ('a, 'e) result -> ('b, 'e) result -> ('a * 'b, 'e) result
Sourceval (let*) : ('a, 'e) result -> ('a -> ('b, 'e) result) -> ('b, 'e) result
Sourceval (and*) : ('a, 'e) result -> ('b, 'e) result -> ('a * 'b, 'e) result
OCaml

Innovation. Community. Security.