base-4.8.2.0: Basic libraries

Copyright | (c) The University of Glasgow 2001
License | BSD-style (see the file libraries/base/LICENSE)
Maintainer | libraries@haskell.org
Stability | experimental
Portability | portable
Safe Haskell | Trustworthy
Language | Haskell2010

Data.Tuple

Description

The tuple data types, and associated functions.

Synopsis

- fst :: (a, b) -> a
- snd :: (a, b) -> b
- curry :: ((a, b) -> c) -> a -> b -> c
- uncurry :: (a -> b -> c) -> (a, b) -> c
- swap :: (a, b) -> (b, a)

# Documentation

fst :: (a, b) -> a

Extract the first component of a pair.

snd :: (a, b) -> b

Extract the second component of a pair.

curry :: ((a, b) -> c) -> a -> b -> c

`curry` converts an uncurried function to a curried function.

uncurry :: (a -> b -> c) -> (a, b) -> c

`uncurry` converts a curried function to a function on pairs.

swap :: (a, b) -> (b, a)

Swap the components of a pair.