module Data.Tuple.Strict where
{-# INLINE mapPair #-}
mapPair :: (a -> c, b -> d) -> (a,b) -> (c,d)
mapPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
mapPair (a -> c
f,b -> d
g) (a
a,b
b) = (a -> c
f a
a, b -> d
g b
b)
{-# INLINE mapFst #-}
mapFst :: (a -> c) -> (a,b) -> (c,b)
mapFst :: (a -> c) -> (a, b) -> (c, b)
mapFst a -> c
f (a
a,b
b) = (a -> c
f a
a, b
b)
{-# INLINE mapSnd #-}
mapSnd :: (b -> c) -> (a,b) -> (a,c)
mapSnd :: (b -> c) -> (a, b) -> (a, c)
mapSnd b -> c
f (a
a,b
b) = (a
a, b -> c
f b
b)
{-# INLINE zipPair #-}
zipPair :: (a,b) -> (c,d) -> ((a,c),(b,d))
zipPair :: (a, b) -> (c, d) -> ((a, c), (b, d))
zipPair (a
a,b
b) (c
c,d
d) = ((a
a,c
c),(b
b,d
d))
{-# INLINE zipWithPair #-}
zipWithPair :: (a -> c -> e, b -> d -> f) -> (a,b) -> (c,d) -> (e,f)
zipWithPair :: (a -> c -> e, b -> d -> f) -> (a, b) -> (c, d) -> (e, f)
zipWithPair (a -> c -> e
e,b -> d -> f
f) (a
a,b
b) (c
c,d
d) = (a -> c -> e
e a
a c
c, b -> d -> f
f b
b d
d)
{-# INLINE swap #-}
swap :: (a,b) -> (b,a)
swap :: (a, b) -> (b, a)
swap (a
a,b
b) = (b
b,a
a)
{-# INLINE mapTriple #-}
mapTriple :: (a -> d, b -> e, c -> f) -> (a,b,c) -> (d,e,f)
mapTriple :: (a -> d, b -> e, c -> f) -> (a, b, c) -> (d, e, f)
mapTriple (a -> d
f,b -> e
g,c -> f
h) (a
a,b
b,c
c) = (a -> d
f a
a, b -> e
g b
b, c -> f
h c
c)
{-# INLINE mapFst3 #-}
mapFst3 :: (a -> d) -> (a,b,c) -> (d,b,c)
mapFst3 :: (a -> d) -> (a, b, c) -> (d, b, c)
mapFst3 a -> d
f (a
a,b
b,c
c) = (a -> d
f a
a, b
b, c
c)
{-# INLINE mapSnd3 #-}
mapSnd3 :: (b -> d) -> (a,b,c) -> (a,d,c)
mapSnd3 :: (b -> d) -> (a, b, c) -> (a, d, c)
mapSnd3 b -> d
f (a
a,b
b,c
c) = (a
a, b -> d
f b
b, c
c)
{-# INLINE mapThd3 #-}
mapThd3 :: (c -> d) -> (a,b,c) -> (a,b,d)
mapThd3 :: (c -> d) -> (a, b, c) -> (a, b, d)
mapThd3 c -> d
f (a
a,b
b,c
c) = (a
a, b
b, c -> d
f c
c)
{-# INLINE zipWithTriple #-}
zipWithTriple ::
(a -> d -> g, b -> e -> h, c -> f -> i) -> (a,b,c) -> (d,e,f) -> (g,h,i)
zipWithTriple :: (a -> d -> g, b -> e -> h, c -> f -> i)
-> (a, b, c) -> (d, e, f) -> (g, h, i)
zipWithTriple (a -> d -> g
g,b -> e -> h
h,c -> f -> i
i) (a
a,b
b,c
c) (d
d,e
e,f
f) = (a -> d -> g
g a
a d
d, b -> e -> h
h b
b e
e, c -> f -> i
i c
c f
f)
{-# INLINE uncurry3 #-}
uncurry3 :: (a -> b -> c -> d) -> ((a, b, c) -> d)
uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d
uncurry3 a -> b -> c -> d
f (a
a,b
b,c
c) = a -> b -> c -> d
f a
a b
b c
c