Some additional operations to apply functions on tuples.
first
:: (a -> b) -> (a, c) -> (b, c)
Apply a function to the first component of a tuple.
second
:: (a -> b) -> (c, a) -> (c, b)
Apply a function to the second component of a tuple.
(***)
:: (a -> b) -> (c -> d) -> (a, c) -> (b, d)
Apply two functions to the two components of a tuple.
(&&&)
:: (a -> b) -> (a -> c) -> a -> (b, c)
Apply two functions to a value and returns a tuple of the results.
both
:: (a -> b) -> (a, a) -> (b, b)
Apply a function to both components of a tuple.