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 b a. Tuple a b -> a

Returns the first component of a tuple.

#snd Source

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

Returns the second component of a tuple.

#curry Source

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

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

#uncurry Source

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

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

#swap Source

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

Exchange the first and second components of a tuple.

#lookup Source

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

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