package either

  1. Overview
  2. Docs
Compatibility Either module

Install

Dune Dependency

Authors

Maintainers

Sources

either-1.0.0.tbz
sha256=bf674de3312dee7b7215f07df1e8a96eb3d679164b8a918cdd95b8d97e505884
sha512=147854c09f897dd028b18a9f19acea8666107aaa7b1aab3c92f568af531364f57298edcaf3897d74246d3857d52e9bfb7ad0fc39220d988d9f14694ca1d5e9ed

doc/either/Either/index.html

Module EitherSource

Sourcetype ('a, 'b) t = ('a, 'b) Either.t =
  1. | Left of 'a
  2. | Right of 'b

This module defines the common Either interface that is provided for all OCaml versions. For documentation of these functions, refer to the standard library.

Sourceval left : 'a -> ('a, 'b) t
Sourceval right : 'b -> ('a, 'b) t
Sourceval is_left : ('a, 'b) t -> bool
Sourceval is_right : ('a, 'b) t -> bool
Sourceval find_left : ('a, 'b) t -> 'a option
Sourceval find_right : ('a, 'b) t -> 'b option
Sourceval map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
Sourceval map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
Sourceval map : left:('a1 -> 'a2) -> right:('b1 -> 'b2) -> ('a1, 'b1) t -> ('a2, 'b2) t
Sourceval fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'c
Sourceval iter : left:('a -> unit) -> right:('b -> unit) -> ('a, 'b) t -> unit
Sourceval for_all : left:('a -> bool) -> right:('b -> bool) -> ('a, 'b) t -> bool
Sourceval equal : left:('a -> 'a -> bool) -> right:('b -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t -> bool
Sourceval compare : left:('a -> 'a -> int) -> right:('b -> 'b -> int) -> ('a, 'b) t -> ('a, 'b) t -> int
OCaml

Innovation. Community. Security.