Module

Data.Tuple

Package
purescript-tuples
Repository
purescript/purescript-tuples

A data type and functions for working with ordered pairs.

#TupleSource

data Tuple a b

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

Constructors

Instances

#fstSource

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

Returns the first component of a tuple.

#sndSource

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

Returns the second component of a tuple.

#currySource

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.

#uncurrySource

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.

#swapSource

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

Exchange the first and second components of a tuple.

#lookupSource

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.