package plebeia

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

1 Result monad

include Monad.S2 with type ('a, 'b) t = ('a, 'b) Stdlib.result
type ('a, 'b) t = ('a, 'b) Stdlib.result
val return : 'a -> ('a, 'z) t
val bind : ('a, 'z) t -> ('a -> ('b, 'z) t) -> ('b, 'z) t
val map : ('a -> 'b) -> ('a, 'z) t -> ('b, 'z) t
val mapM : ('a -> ('b, 'z) t) -> 'a list -> ('b list, 'z) t
val mapM_ : ('a -> (unit, 'z) t) -> 'a list -> (unit, 'z) t
val iterM : ('a -> (unit, 'z) t) -> 'a list -> (unit, 'z) t

alias of mapM_

val fold_leftM : ('a -> 'b -> ('a, 'z) t) -> 'a -> 'b list -> ('a, 'z) t
val parseM : ('a -> 'b list -> ('a * 'b list, 'error) t) -> 'a -> 'b list -> ('a, 'error) t
module Infix : sig ... end
module Syntax : sig ... end
val map_error : ('err1 -> 'err2) -> ('a, 'err1) t -> ('a, 'err2) t
val from_Ok : ('a, _) t -> 'a

It raises Failure _ when the argument is Error _.

val from_Error : (_, 'e) t -> 'e

It raises Failure _ when the argument is Ok _.

val default : ('a, 'e) t -> ('e -> 'a) -> 'a

Error recovery

val errorf : ('a, unit, string, ('b, string) t) Stdlib.format4 -> 'a

Printf interface to produce a string error

OCaml

Innovation. Community. Security.