Copyright | (c) The University of Glasgow 2001 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | [email protected] |
Stability | experimental |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Functions associated with the tuple data types.
Extract the first component of a pair.
Extract the second component of a pair.
curry :: ((a, b) -> c) -> a -> b -> c Source
curry
converts an uncurried function to a curried function.
>>> curry fst 1 2 1
uncurry :: (a -> b -> c) -> (a, b) -> c Source
uncurry
converts a curried function to a function on pairs.
>>> uncurry (+) (1,2) 3
>>> uncurry ($) (show, 1) "1"
>>> map (uncurry max) [(1,2), (3,4), (6,8)] [2,4,8]
swap :: (a, b) -> (b, a) Source
Swap the components of a pair.
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/8.8.3/docs/html/libraries/base-4.13.0.0/Data-Tuple.html