package containers
A modular, clean and powerful extension of the OCaml standard library
Install
Dune Dependency
Authors
Maintainers
Sources
v2.8.tar.gz
md5=03b80e963186e91ddac62ef645bf7fb2
sha512=c8f434808be540c16926bf03d89f394d33fc2d092f963a7b6d412481229e0a96290f1ad7c7d522415115d35426b7aa0b3fda4b991ddc321dad279d402c9a0c0b
doc/containers/CCPair/index.html
Module CCPair
Source
Tuple Functions
map1 f (x, y)
returns (f x, y)
.
map2 f (x, y)
returns (x, f y)
.
Synonym to (***)
. Map on both sides of a tuple.
Like map
but specialized for pairs with elements of the same type.
Compose the given function with fst
.
Compose the given function with snd
.
Swap the components of the tuple.
Map on the left side of the tuple.
Map on the right side of the tuple.
Map on both sides of a tuple.
f &&& g
is fun x -> f x, g x
. It splits the computations into two parts.
Uncurrying (merges the two components of a tuple).
dup x = (x,x)
(duplicate the value).
dup_map f x = (x, f x)
. Duplicates the value and applies the function to the second copy.
Print tuple in a string
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page