Module

Data.Tuple

Package
purescript-tuples
Repository
purescript/purescript-tuples

A data type and functions for working with ordered pairs.

#Tuple Source

data Tuple a b

A simple product type for wrapping a pair of component values.

Constructors

Instances

#fst Source

fst :: forall a b. Tuple a b -> a

Returns the first component of a tuple.

#snd Source

snd :: forall a b. Tuple a b -> b

Returns the second component of a tuple.

#curry Source

curry :: forall a b c. (Tuple a b -> c) -> a -> b -> c

Turn a function that expects a tuple into a function of two arguments.

#uncurry Source

uncurry :: forall a b c. (a -> b -> c) -> Tuple a b -> c

Turn a function of two arguments into a function that expects a tuple.

#swap Source

swap :: forall a b. Tuple a b -> Tuple b a

Exchange the first and second components of a tuple.

#lookup Source

lookup :: forall a b f. Foldable f => Eq a => a -> f (Tuple a b) -> Maybe b

Lookup a value in a data structure of Tuples, generalizing association lists.