package preface

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

Parameters

Signature

type 'a t = 'a Infix.t

Type

The type held by the Decidable.

Functions

include Preface_specs.Decidable.WITH_LOSE_AND_CHOOSE with type 'a t := 'a t
val lose : ('a -> Preface_core.Void.t) -> 'a t

Since Void.t is identity for Either.t, lose act as an identity for Decidable.

val choose : ('a -> ('b, 'c) Preface_core.Shims.Either.t) -> 'b t -> 'c t -> 'a t

choose f x y says that if f can handle either x or y it can handle the result of the function.

include Preface_specs.Divisible.WITH_CONTRAMAP_AND_DIVIDE_AND_CONQUER with type 'a t := 'a t
include Preface_specs.Divisible.WITH_DIVIDE_AND_CONQUER with type 'a t := 'a t
val divide : ('a -> 'b * 'c) -> 'b t -> 'c t -> 'a t

The contravariant version of apply from Applicative.

val conquer : 'a t

Provide and empty value.

include Preface_specs.Contravariant.WITH_CONTRAMAP with type 'a t := 'a t
val contramap : ('a -> 'b) -> 'b t -> 'a t

Mapping over from 'a to 'b over 'b t to 'a t.

lose acting on identity.

val chosen : 'a t -> 'b t -> ('a, 'b) Preface_core.Shims.Either.t t

choose acting on identity.

include Preface_specs.Divisible.OPERATION with type 'a t := 'a t
val divided : 'a t -> 'b t -> ('a * 'b) t
val conquered : unit t
include Preface_specs.Contravariant.OPERATION with type 'a t := 'a t
val replace : 'b -> 'b t -> 'a t

Replace all locations in the output with the same value.

Infix operators

module Infix : Preface_specs.Decidable.INFIX with type 'a t = 'a t
val (>|<) : 'a t -> 'b t -> ('a, 'b) Preface_core.Shims.Either.t t

Infix version of chosen.

val (^|^) : 'a t -> 'b t -> ('a, 'b) Preface_core.Shims.Either.t t

Right-associative version of >|<.

include Preface_specs.Divisible.INFIX with type 'a t := 'a t
val (>*<) : 'a t -> 'b t -> ('a * 'b) t

Infix version of divided.

val (^*^) : 'a t -> 'b t -> ('a * 'b) t

Right-associative version of >*<.

val (>*) : 'a t -> unit t -> 'a t

Discard the value of the second argument.

val (^*) : 'a t -> unit t -> 'a t

Right-associative version of >*.

val (*<) : unit t -> 'a t -> 'a t

Discard the value of the first argument.

val (&*) : unit t -> 'a t -> 'a t

Right-associative version of *<.

include Preface_specs.Contravariant.INFIX with type 'a t := 'a t
val (>$) : 'b -> 'b t -> 'a t

Infix version of OPERATION.replace.

val (^$) : 'b -> 'b t -> 'a t

Right-associative version of >$.

val ($<) : 'b t -> 'b -> 'a t

Infix flipped version of OPERATION.replace.

val (&$) : 'b t -> 'b -> 'a t

Right-associative version of $<.

val (>$<) : ('a -> 'b) -> 'b t -> 'a t

Infix version of CORE.map.

val (^$^) : ('a -> 'b) -> 'b t -> 'a t

Right-associative version of >$<.

val (>&<) : 'b t -> ('a -> 'b) -> 'a t

Infix flipped version of CORE.map.

val (^&^) : 'b t -> ('a -> 'b) -> 'a t

Right-associative version of >&<.

OCaml

Innovation. Community. Security.