package accessor_base

  1. Overview
  2. Docs

Module Accessor_base.Tuple2Source

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

Access the first component of a tuple.

Sourceval 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.

Sourceval fsti : (('i * 'it) -> 'a -> 'b, 'it -> ('a * 'i) -> 'b * 'i, [< Accessor_base__.Import.field ]) Accessor.General.t
Sourceval sndi : (('i * 'it) -> 'a -> 'b, 'it -> ('i * 'a) -> 'i * 'b, [< Accessor_base__.Import.field ]) Accessor.General.t
Sourceval 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.

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

Access both components of a tuple.

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

Innovation. Community. Security.