---------------------------------------------------------------------
--
-- Module      :  Uniform.Tuples (beyond pairs)
                -- a restricted collection of operations on tuples 
                -- and nothing else 
                    -- with imports as far as I found similar code
----------------------------------------------------------------------

module  Uniform.Tuples (module Uniform.Tuples
                    , module Data.Tuple.Extra
                    ) where

import Data.Tuple.Extra (first, second, fst3, snd3, thd3, both)

trd3 :: (a, b, c) -> c
trd3 :: forall a b c. (a, b, c) -> c
trd3 (a
x, b
y, c
z) = c
z

-- could copy from hledger-utils 

fst4 :: (a, b, c, d) -> a
fst4 :: forall a b c d. (a, b, c, d) -> a
fst4 (a
x, b
y, c
z, d
w) = a
x

snd4 :: (a, b, c, d) -> b
snd4 :: forall a b c d. (a, b, c, d) -> b
snd4 (a
x, b
y, c
z, d
w) = b
y

trd4 :: (a, b, c, d) -> c
trd4 :: forall a b c d. (a, b, c, d) -> c
trd4 (a
x, b
y, c
z, d
w) = c
z

thd4 :: (a, b, c, d) -> c
thd4 :: forall a b c d. (a, b, c, d) -> c
thd4 = forall a b c d. (a, b, c, d) -> c
trd4

fth4 :: (a, b, c, d) -> d
fth4 :: forall a b c d. (a, b, c, d) -> d
fth4 (a
x, b
y, c
z, d
w) = d
w

fst5 :: (a, b, c, d, e) -> a
fst5 :: forall a b c d e. (a, b, c, d, e) -> a
fst5 (a
x, b
y, c
z, d
w, e
u) = a
x

snd5 :: (a, b, c, d, e) -> b
snd5 :: forall a b c d e. (a, b, c, d, e) -> b
snd5 (a
x, b
y, c
z, d
w, e
u) = b
y

thd5 :: (a, b, c, d, e) -> c
thd5 :: forall a b c d e. (a, b, c, d, e) -> c
thd5 (a
x, b
y, c
z, d
w, e
u) = c
z

trd5 :: (a, b, c, d, e) -> c
trd5 :: forall a b c d e. (a, b, c, d, e) -> c
trd5 = forall a b c d e. (a, b, c, d, e) -> c
thd5

fth5 :: (a, b, c, d, e) -> d
fth5 :: forall a b c d e. (a, b, c, d, e) -> d
fth5 (a
x, b
y, c
z, d
w, e
u) = d
w

ffh5 :: (a, b, c, d, e) -> e
ffh5 :: forall a b c d e. (a, b, c, d, e) -> e
ffh5 (a
x, b
y, c
z, d
w, e
u) = e
u

first3 :: (a1 -> b) -> (a1, a2, a3) -> (b, a2, a3)
first3 :: forall a1 b a2 a3. (a1 -> b) -> (a1, a2, a3) -> (b, a2, a3)
first3 a1 -> b
f (a1
a1, a2
a2, a3
a3) = (a1 -> b
f a1
a1, a2
a2, a3
a3)

second3 :: (a2 -> b) -> (a1, a2, a3) -> (a1, b, a3)
second3 :: forall a2 b a1 a3. (a2 -> b) -> (a1, a2, a3) -> (a1, b, a3)
second3 a2 -> b
f (a1
a1, a2
a2, a3
a3) = (a1
a1, a2 -> b
f a2
a2, a3
a3)

third3 :: (a3 -> b) -> (a1, a2, a3) -> (a1, a2, b)
third3 :: forall a3 b a1 a2. (a3 -> b) -> (a1, a2, a3) -> (a1, a2, b)
third3 a3 -> b
f (a1
a1, a2
a2, a3
a3) = (a1
a1, a2
a2, a3 -> b
f a3
a3)

first4 :: (a1 -> b) -> (a1, a2, a3, a4) -> (b, a2, a3, a4)
first4 :: forall a1 b a2 a3 a4.
(a1 -> b) -> (a1, a2, a3, a4) -> (b, a2, a3, a4)
first4 a1 -> b
f (a1
a1, a2
a2, a3
a3, a4
a4) = (a1 -> b
f a1
a1, a2
a2, a3
a3, a4
a4)

second4 :: (a2 -> b) -> (a1, a2, a3, a4) -> (a1, b, a3, a4)
second4 :: forall a2 b a1 a3 a4.
(a2 -> b) -> (a1, a2, a3, a4) -> (a1, b, a3, a4)
second4 a2 -> b
f (a1
a1, a2
a2, a3
a3, a4
a4) = (a1
a1, a2 -> b
f a2
a2, a3
a3, a4
a4)

third4 :: (a3 -> b) -> (a1, a2, a3, a4) -> (a1, a2, b, a4)
third4 :: forall a3 b a1 a2 a4.
(a3 -> b) -> (a1, a2, a3, a4) -> (a1, a2, b, a4)
third4 a3 -> b
f (a1
a1, a2
a2, a3
a3, a4
a4) = (a1
a1, a2
a2, a3 -> b
f a3
a3, a4
a4)

fourth4 :: (a4 -> b) -> (a1, a2, a3, a4) -> (a1, a2, a3, b)
fourth4 :: forall a4 b a1 a2 a3.
(a4 -> b) -> (a1, a2, a3, a4) -> (a1, a2, a3, b)
fourth4 a4 -> b
f (a1
a1, a2
a2, a3
a3, a4
a4) = (a1
a1, a2
a2, a3
a3, a4 -> b
f a4
a4)