module Data.Tuple.Lazy where
mapPair :: (a -> c, b -> d) -> (a,b) -> (c,d)
mapPair ~(f,g) ~(a,b) = (f a, g b)
mapFst :: (a -> c) -> (a,b) -> (c,b)
mapFst f ~(a,b) = (f a, b)
mapSnd :: (b -> c) -> (a,b) -> (a,c)
mapSnd f ~(a,b) = (a, f b)
zipWithPair :: (a -> c -> e, b -> d -> f) -> (a,b) -> (c,d) -> (e,f)
zipWithPair ~(e,f) ~(a,b) ~(c,d) = (e a c, f b d)
swap :: (a,b) -> (b,a)
swap ~(a,b) = (b,a)
forcePair :: (a,b) -> (a,b)
forcePair ~(a,b) = (a,b)
mapTriple :: (a -> d, b -> e, c -> f) -> (a,b,c) -> (d,e,f)
mapTriple ~(f,g,h) ~(a,b,c) = (f a, g b, h c)
mapFst3 :: (a -> d) -> (a,b,c) -> (d,b,c)
mapFst3 f ~(a,b,c) = (f a, b, c)
mapSnd3 :: (b -> d) -> (a,b,c) -> (a,d,c)
mapSnd3 f ~(a,b,c) = (a, f b, c)
mapThd3 :: (c -> d) -> (a,b,c) -> (a,b,d)
mapThd3 f ~(a,b,c) = (a, b, f c)
zipWithTriple ::
(a -> d -> g, b -> e -> h, c -> f -> i) -> (a,b,c) -> (d,e,f) -> (g,h,i)
zipWithTriple ~(g,h,i) ~(a,b,c) ~(d,e,f) = (g a d, h b e, i c f)
uncurry3 :: (a -> b -> c -> d) -> ((a, b, c) -> d)
uncurry3 f ~(a,b,c) = f a b c