Functions associated with the tuple data types.
fst :: (a, b) -> a Source #
Extract the first component of a pair.
snd :: (a, b) -> b Source #
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
>>> curry fst 1 2 1
>>>
curry fst 1 2
uncurry :: (a -> b -> c) -> (a, b) -> c Source #
uncurry converts a curried function to a function on pairs.
uncurry
>>> uncurry (+) (1,2) 3
uncurry (+) (1,2)
>>> uncurry ($) (show, 1) "1"
uncurry ($) (show, 1)
>>> map (uncurry max) [(1,2), (3,4), (6,8)] [2,4,8]
map (uncurry max) [(1,2), (3,4), (6,8)]
swap :: (a, b) -> (b, a) Source #
Swap the components of a pair.