package preface

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

Parameters

module Req : Preface_specs.Arrow_zero.WITH_NEUTRAL with type ('a, 'b) t = ('a, 'b) Arrow.t

Signature

Type

type ('a, 'b) t = ('a, 'b) Req.t

The type held by the Arrow_zero.

Functions

val neutral : ('a, 'b) t

The neutral element of the Arrow_zero.

include Preface_specs.Category.WITH_ID with type ('a, 'b) t := ('a, 'b) t
val id : ('a, 'a) t

The identity morphism.

include Preface_specs.Semigroupoid.WITH_COMPOSE with type ('a, 'b) t := ('a, 'b) t
val compose : ('b, 'c) t -> ('a, 'b) t -> ('a, 'c) t

Morphism composition (from right to left).

val fst : ('a, 'b) t -> ('a * 'd, 'b * 'd) t

Send the first component of the input through the argument Arrow, and copy the rest unchanged to the output.

val arrow : ('a -> 'b) -> ('a, 'b) t

Lift a function to an Arrow.

val split : ('a, 'b) t -> ('c, 'd) t -> ('a * 'c, 'b * 'd) t

Split the input between the two given Arrows and combine their output.

val compose_right_to_left : ('b, 'c) t -> ('a, 'b) t -> ('a, 'c) t

An alias of CORE.compose.

val compose_left_to_right : ('a, 'b) t -> ('b, 'c) t -> ('a, 'c) t

An alias of CORE.compose with flipped argument.

val return : unit -> ('a, 'a) t

Represent the identity Arrow.

val snd : ('a, 'b) t -> ('d * 'a, 'd * 'b) t

Send the second component of the input through the given Arrow, and copy the rest unchanged to the output.

val fan_out : ('a, 'b) t -> ('a, 'c) t -> ('a, 'b * 'c) t

Send the input to both argument arrows and combine their output.

val pre_compose_left_to_right : ('a -> 'b) -> ('b, 'c) t -> ('a, 'c) t

Pre composition with a function (the function should be pure).

val post_compose_left_to_right : ('a, 'b) t -> ('b -> 'c) -> ('a, 'c) t

Post composition with a function (the function should be pure).

val pre_compose_right_to_left : ('b, 'c) t -> ('a -> 'b) -> ('a, 'c) t
val post_compose_right_to_left : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) t

Infix operators

module Infix : Preface_specs.Arrow_zero.INFIX with type ('a, 'b) t = ('a, 'b) t
val (%) : ('b, 'c) t -> ('a, 'b) t -> ('a, 'c) t

An alias of CORE.compose (to be iso with Preface_core).

val (<%) : ('b, 'c) t -> ('a, 'b) t -> ('a, 'c) t

An alias of CORE.compose (to be iso with Preface_core).

val (%>) : ('a, 'b) t -> ('b, 'c) t -> ('a, 'c) t

An alias of OPERATION.compose_left_to_right (to be iso with Preface_core).

val (<<<) : ('b, 'c) t -> ('a, 'b) t -> ('a, 'c) t

An alias of CORE.compose (to be iso with Haskell's approach). Even <<< looks like <% (it is an alias for the same function), they differ in their priorities. OCaml documentation of operators priorities

val (>>>) : ('a, 'b) t -> ('b, 'c) t -> ('a, 'c) t

An alias of CORE.compose_left_to_right (to be iso with Haskell's approach). Even >>> looks like %> (it is an alias for the same function), they differ in their priorities. OCaml documentation of operators priorities

val (***) : ('a, 'b) t -> ('c, 'd) t -> ('a * 'c, 'b * 'd) t
val (&&&) : ('a, 'b) t -> ('a, 'c) t -> ('a, 'b * 'c) t
val (^>>) : ('a -> 'b) -> ('b, 'c) t -> ('a, 'c) t
val (>>^) : ('a, 'b) t -> ('b -> 'c) -> ('a, 'c) t
val (<<^) : ('b, 'c) t -> ('a -> 'b) -> ('a, 'c) t
val (^<<) : ('b -> 'c) -> ('a, 'b) t -> ('a, 'c) t
OCaml

Innovation. Community. Security.