Module Arrow_choice.Operation_over_category

Parameters

module Core : Preface_specs.Arrow_choice.CORE with type ('a, 'b) t = ('a, 'b) Category.t

Signature

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

The type held by the Arrow.

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
val right : ('a, 'b) t -> (('c, 'a) Stdlib.Either.t, ('c, 'b) Stdlib.Either.t) t

The mirror image of left.

val fan_in : ('a, 'c) t -> ('b, 'c) t -> (('a, 'b) Stdlib.Either.t, 'c) t

Split the input between the two argument arrows and merge their outputs.