raft-0.3.7.2: Miscellaneous Haskell utilities for data structures and data manipulation.

Safe HaskellSafe
LanguageHaskell2010

Data.Tuple.Util

Contents

Description

Functions for manipulating tuples, supplementing Data.Tuple.

Synopsis

Functions on pairs.

($$) :: Monad ((->) a) => (a -> b, a -> c) -> a -> (b, c) Source #

Apply a pair of functions to a value.

Functions on triplets.

curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d Source #

Curry a triplet.

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source #

Uncurry a triplet.

fst3 :: (a, b, c) -> a Source #

Extract the first entry of a triplet.

snd3 :: (a, b, c) -> b Source #

Extract the second entry of a triplet.

trd3 :: (a, b, c) -> c Source #

Extract the third entry of a triplet.

first3 :: Arrow a => a b c -> a (b, d, e) (c, d, e) Source #

Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.

second3 :: Arrow a => a b c -> a (d, b, e) (d, c, e) Source #

Send the second component of the input through the argument arrow, and copy the rest unchanged to the output.

third3 :: Arrow a => a b c -> a (d, e, b) (d, e, c) Source #

Send the third component of the input through the argument arrow, and copy the rest unchanged to the output.

Functions on quadruplets.

curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -> e Source #

Curry a quadruplet.

uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e Source #

Uncurry a quadruplet.

fst4 :: (a, b, c, d) -> a Source #

Extract the first entry of a quadruplet.

snd4 :: (a, b, c, d) -> b Source #

Extract the second entry of a quadruplet.

trd4 :: (a, b, c, d) -> c Source #

Extract the third entry of a quadruplet.

fth4 :: (a, b, c, d) -> d Source #

Extract the fourth entry of a quadruplet.

first4 :: Arrow a => a b c -> a (b, d, e, f) (c, d, e, f) Source #

Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.

second4 :: Arrow a => a b c -> a (d, b, e, f) (d, c, e, f) Source #

Send the second component of the input through the argument arrow, and copy the rest unchanged to the output.

third4 :: Arrow a => a b c -> a (d, e, b, f) (d, e, c, f) Source #

Send the third component of the input through the argument arrow, and copy the rest unchanged to the output.

fourth4 :: Arrow a => a b c -> a (d, e, f, b) (d, e, f, c) Source #

Send the fourth component of the input through the argument arrow, and copy the rest unchanged to the output.