package accessor_base

  1. Overview
  2. Docs
val fst : ('i -> 'a -> 'b, 'i -> ('a * 'c) -> 'b * 'c, [< Accessor_base__.Import.field ]) Accessor.General.t

Access the first component of a tuple.

val snd : ('i -> 'a -> 'b, 'i -> ('c * 'a) -> 'c * 'b, [< Accessor_base__.Import.field ]) Accessor.General.t

Access the second component of a tuple.

fsti and sndi are like fst and snd, but they also treat the untargetted component as an index. For example, if you use sndi on x, y, y is what you are accessing, and x will be given to you as an index.

val fsti : (('i * 'it) -> 'a -> 'b, 'it -> ('a * 'i) -> 'b * 'i, [< Accessor_base__.Import.field ]) Accessor.General.t
val sndi : (('i * 'it) -> 'a -> 'b, 'it -> ('i * 'a) -> 'i * 'b, [< Accessor_base__.Import.field ]) Accessor.General.t
val swap : ('i -> ('a * 'b) -> 'c * 'd, 'i -> ('b * 'a) -> 'd * 'c, [< Accessor_base__.Import.isomorphism ]) Accessor.General.t

Access a tuple where the components are swapped with each other.

assocl and assocr reassociate nested tuples.

val assocl : ('i -> (('a * 'b) * 'c) -> ('d * 'e) * 'f, 'i -> ('a * ('b * 'c)) -> 'd * ('e * 'f), [< Accessor_base__.Import.isomorphism ]) Accessor.General.t
val assocr : ('i -> ('a * ('b * 'c)) -> 'd * ('e * 'f), 'i -> (('a * 'b) * 'c) -> ('d * 'e) * 'f, [< Accessor_base__.Import.isomorphism ]) Accessor.General.t
val each : ('i -> 'a -> 'b, 'i -> ('a * 'a) -> 'b * 'b, [< Accessor_base__.Import.nonempty ]) Accessor.General.t

Access both components of a tuple.

module Fst : Accessor.Functor.S2 with type ('fst, 'snd) t := 'fst * 'snd
module Snd : Accessor.Functor.S2 with type ('snd, 'fst) t := 'fst * 'snd
OCaml

Innovation. Community. Security.