Module Data.Tuple.Extra

Author
Michael Hanus, Fredrik Wieczerkowski
Version
September 2026

Some additional operations to apply functions on tuples.

Exported Functions:

Exported Functions


first :: (a -> b) -> (a, c) -> (b, c)  Deterministic 

Apply a function to the first component of a tuple.


second :: (a -> b) -> (c, a) -> (c, b)  Deterministic 

Apply a function to the second component of a tuple.


(***) :: (a -> b) -> (c -> d) -> (a, c) -> (b, d)  Deterministic 

Apply two functions to the two components of a tuple.


(&&&) :: (a -> b) -> (a -> c) -> a -> (b, c)  Deterministic 

Apply two functions to a value and returns a tuple of the results.


both :: (a -> b) -> (a, a) -> (b, b)  Deterministic 

Apply a function to both components of a tuple.