package bastet

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

Result is the equivalent of Either in Haskell for Ocaml

val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
val const : 'a -> 'b -> 'a
val result : ('a -> 'c) -> ('b -> 'c) -> ('a, 'b) result -> 'c
module type MAGMA_F = functor (T : Interface.TYPE) -> functor (M : Interface.MAGMA) -> Interface.MAGMA with type t = (M.t, T.t) result
module type MEDIAL_MAGMA_F = functor (T : Interface.TYPE) -> functor (M : Interface.MAGMA) -> Interface.MEDIAL_MAGMA with type t = (M.t, T.t) result
module type SEMIGROUP_F = functor (T : Interface.TYPE) -> functor (S : Interface.SEMIGROUP) -> Interface.SEMIGROUP with type t = (S.t, T.t) result
module type FUNCTOR_F = functor (T : Interface.TYPE) -> Interface.FUNCTOR with type 'a t = ('a, T.t) result
module type APPLY_F = functor (T : Interface.TYPE) -> Interface.APPLY with type 'a t = ('a, T.t) result
module type APPLICATIVE_F = functor (T : Interface.TYPE) -> Interface.APPLICATIVE with type 'a t = ('a, T.t) result
module type MONAD_F = functor (T : Interface.TYPE) -> Interface.MONAD with type 'a t = ('a, T.t) result
module type ALT_F = functor (T : Interface.TYPE) -> Interface.ALT with type 'a t = ('a, T.t) result
module type EXTEND_F = functor (T : Interface.TYPE) -> Interface.EXTEND with type 'a t = ('a, T.t) result
module type SHOW_F = functor (Ok : Interface.SHOW) -> functor (Error : Interface.SHOW) -> Interface.SHOW with type t = (Ok.t, Error.t) result
module type EQ_F = functor (Ok : Interface.EQ) -> functor (Error : Interface.EQ) -> Interface.EQ with type t = (Ok.t, Error.t) result
module type ORD_F = functor (Ok : Interface.ORD) -> functor (Error : Interface.ORD) -> Interface.ORD with type t = (Ok.t, Error.t) result
module type BOUNDED_F = functor (Ok : Interface.BOUNDED) -> functor (Error : Interface.BOUNDED) -> Interface.BOUNDED with type t = (Ok.t, Error.t) result
module type FOLDABLE_F = functor (T : Interface.TYPE) -> Interface.FOLDABLE with type 'a t = ('a, T.t) result
module type TRAVERSABLE_F = functor (T : Interface.TYPE) -> functor (A : Interface.APPLICATIVE) -> Interface.TRAVERSABLE with type 'a t = ('a, T.t) result and type 'a applicative_t = 'a A.t
module type BITRAVERSABLE_F = functor (A : Interface.APPLICATIVE) -> Interface.BITRAVERSABLE with type ('a, 'b) t = ('a, 'b) result and type 'a applicative_t = 'a A.t
module Magma : MAGMA_F
module Bifunctor : Interface.BIFUNCTOR with type ('a, 'b) t = ('a, 'b) result
module Apply : APPLY_F
module Monad : MONAD_F
module Alt : ALT_F
module Extend : EXTEND_F
module Show : SHOW_F
module Eq : EQ_F
module Ord : ORD_F
module Many_Valued_Logic : sig ... end

Many valued logics in general have to relax certain constraints in order to be heyting or boolean algebras, such as:

module Bifoldable : Interface.BIFOLDABLE with type ('a, 'b) t = ('a, 'b) result
module Infix : sig ... end
module Choose (A : Interface.ALT) : sig ... end
module Unsafe : sig ... end
val is_ok : ('a, 'b) result -> bool
val is_error : ('a, 'b) result -> bool
val note : 'err -> 'a option -> ('a, 'err) result
val hush : ('a, 'err) result -> 'a option
OCaml

Innovation. Community. Security.