-- | Helper functions for tuples

module Bitcoin.Misc.Tuple where

--------------------------------------------------------------------------------

fst3 :: (a,b,c) -> a
fst3 (x,_,_) = x

snd3 :: (a,b,c) -> b
snd3 (_,y,_) = y

thd3 :: (a,b,c) -> c
thd3 (_,_,z) = z

--------------------------------------------------------------------------------

swap :: (a,b) -> (b,a)
swap (x,y) = (y,x)

--------------------------------------------------------------------------------