{-# LANGUAGE Safe #-} {- | Module : SDP.Zip Copyright : (c) Andrey Mulik 2019 License : BSD-style Maintainer : work.a.mulik@gmail.com Portability : portable "SDP.Zip" provides 'Zip' - class of 'Control.Applicative.ZipList"-like structures. -} module SDP.Zip ( Zip (..) ) where import Prelude () import SDP.SafePrelude default () -------------------------------------------------------------------------------- -- | Zip is generalization of ZipList applicative semantics (but without pure). class (Functor z) => Zip z where {-# MINIMAL (zap | zipWith), all2, any2 #-} -- | ZipList-like '<*>' zap :: z (a -> b) -> z a -> z b zap = ((a -> b) -> a -> b) -> z (a -> b) -> z a -> z b forall (z :: * -> *) a b c. Zip z => (a -> b -> c) -> z a -> z b -> z c zipWith (a -> b) -> a -> b forall a b. (a -> b) -> a -> b ($) all2 :: (a -> b -> Bool) -> z a -> z b -> Bool all3 :: (a -> b -> c -> Bool) -> z a -> z b -> z c -> Bool all4 :: (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z d -> Bool all5 :: (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z e -> Bool all6 :: (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z f -> Bool all3 a -> b -> c -> Bool f = ((c -> Bool) -> c -> Bool) -> z (c -> Bool) -> z c -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool all2 (c -> Bool) -> c -> Bool forall a b. (a -> b) -> a -> b ($) (z (c -> Bool) -> z c -> Bool) -> (z a -> z b -> z (c -> Bool)) -> z a -> z b -> z c -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> Bool) -> z a -> z b -> z (c -> Bool) forall (z :: * -> *) a b c. Zip z => (a -> b -> c) -> z a -> z b -> z c zipWith a -> b -> c -> Bool f all4 a -> b -> c -> d -> Bool f z a as = ((d -> Bool) -> d -> Bool) -> z (d -> Bool) -> z d -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool all2 (d -> Bool) -> d -> Bool forall a b. (a -> b) -> a -> b ($) (z (d -> Bool) -> z d -> Bool) -> (z b -> z c -> z (d -> Bool)) -> z b -> z c -> z d -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z (d -> Bool) forall (z :: * -> *) a b c d. Zip z => (a -> b -> c -> d) -> z a -> z b -> z c -> z d zipWith3 a -> b -> c -> d -> Bool f z a as all5 a -> b -> c -> d -> e -> Bool f z a as z b bs = ((e -> Bool) -> e -> Bool) -> z (e -> Bool) -> z e -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool all2 (e -> Bool) -> e -> Bool forall a b. (a -> b) -> a -> b ($) (z (e -> Bool) -> z e -> Bool) -> (z c -> z d -> z (e -> Bool)) -> z c -> z d -> z e -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z (e -> Bool) forall (z :: * -> *) a b c d e. Zip z => (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z d -> z e zipWith4 a -> b -> c -> d -> e -> Bool f z a as z b bs all6 a -> b -> c -> d -> e -> f -> Bool f z a as z b bs z c cs = ((f -> Bool) -> f -> Bool) -> z (f -> Bool) -> z f -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool all2 (f -> Bool) -> f -> Bool forall a b. (a -> b) -> a -> b ($) (z (f -> Bool) -> z f -> Bool) -> (z d -> z e -> z (f -> Bool)) -> z d -> z e -> z f -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z (f -> Bool) forall (z :: * -> *) a b c d e f. Zip z => (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z e -> z f zipWith5 a -> b -> c -> d -> e -> f -> Bool f z a as z b bs z c cs any2 :: (a -> b -> Bool) -> z a -> z b -> Bool any3 :: (a -> b -> c -> Bool) -> z a -> z b -> z c -> Bool any4 :: (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z d -> Bool any5 :: (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z e -> Bool any6 :: (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z f -> Bool any3 a -> b -> c -> Bool f = ((c -> Bool) -> c -> Bool) -> z (c -> Bool) -> z c -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool any2 (c -> Bool) -> c -> Bool forall a b. (a -> b) -> a -> b ($) (z (c -> Bool) -> z c -> Bool) -> (z a -> z b -> z (c -> Bool)) -> z a -> z b -> z c -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> Bool) -> z a -> z b -> z (c -> Bool) forall (z :: * -> *) a b c. Zip z => (a -> b -> c) -> z a -> z b -> z c zipWith a -> b -> c -> Bool f any4 a -> b -> c -> d -> Bool f z a as = ((d -> Bool) -> d -> Bool) -> z (d -> Bool) -> z d -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool any2 (d -> Bool) -> d -> Bool forall a b. (a -> b) -> a -> b ($) (z (d -> Bool) -> z d -> Bool) -> (z b -> z c -> z (d -> Bool)) -> z b -> z c -> z d -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z (d -> Bool) forall (z :: * -> *) a b c d. Zip z => (a -> b -> c -> d) -> z a -> z b -> z c -> z d zipWith3 a -> b -> c -> d -> Bool f z a as any5 a -> b -> c -> d -> e -> Bool f z a as z b bs = ((e -> Bool) -> e -> Bool) -> z (e -> Bool) -> z e -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool any2 (e -> Bool) -> e -> Bool forall a b. (a -> b) -> a -> b ($) (z (e -> Bool) -> z e -> Bool) -> (z c -> z d -> z (e -> Bool)) -> z c -> z d -> z e -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z (e -> Bool) forall (z :: * -> *) a b c d e. Zip z => (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z d -> z e zipWith4 a -> b -> c -> d -> e -> Bool f z a as z b bs any6 a -> b -> c -> d -> e -> f -> Bool f z a as z b bs z c cs = ((f -> Bool) -> f -> Bool) -> z (f -> Bool) -> z f -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool any2 (f -> Bool) -> f -> Bool forall a b. (a -> b) -> a -> b ($) (z (f -> Bool) -> z f -> Bool) -> (z d -> z e -> z (f -> Bool)) -> z d -> z e -> z f -> Bool forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z (f -> Bool) forall (z :: * -> *) a b c d e f. Zip z => (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z e -> z f zipWith5 a -> b -> c -> d -> e -> f -> Bool f z a as z b bs z c cs zip :: z a -> z b -> z (a, b) zip3 :: z a -> z b -> z c -> z (a, b, c) zip4 :: z a -> z b -> z c -> z d -> z (a, b, c, d) zip5 :: z a -> z b -> z c -> z d -> z e -> z (a, b, c, d, e) zip6 :: z a -> z b -> z c -> z d -> z e -> z f -> z (a, b, c, d, e, f) zip = (a -> b -> (a, b)) -> z a -> z b -> z (a, b) forall (z :: * -> *) a b c. Zip z => (a -> b -> c) -> z a -> z b -> z c zipWith (,) zip3 = (a -> b -> c -> (a, b, c)) -> z a -> z b -> z c -> z (a, b, c) forall (z :: * -> *) a b c d. Zip z => (a -> b -> c -> d) -> z a -> z b -> z c -> z d zipWith3 (,,) zip4 = (a -> b -> c -> d -> (a, b, c, d)) -> z a -> z b -> z c -> z d -> z (a, b, c, d) forall (z :: * -> *) a b c d e. Zip z => (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z d -> z e zipWith4 (,,,) zip5 = (a -> b -> c -> d -> e -> (a, b, c, d, e)) -> z a -> z b -> z c -> z d -> z e -> z (a, b, c, d, e) forall (z :: * -> *) a b c d e f. Zip z => (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z e -> z f zipWith5 (,,,,) zip6 = (a -> b -> c -> d -> e -> f -> (a, b, c, d, e, f)) -> z a -> z b -> z c -> z d -> z e -> z f -> z (a, b, c, d, e, f) forall (z :: * -> *) a b c d e f g. Zip z => (a -> b -> c -> d -> e -> f -> g) -> z a -> z b -> z c -> z d -> z e -> z f -> z g zipWith6 (,,,,,) zipWith :: (a -> b -> c) -> z a -> z b -> z c zipWith3 :: (a -> b -> c -> d) -> z a -> z b -> z c -> z d zipWith4 :: (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z d -> z e zipWith5 :: (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z e -> z f zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> z a -> z b -> z c -> z d -> z e -> z f -> z g zipWith = z (b -> c) -> z b -> z c forall (z :: * -> *) a b. Zip z => z (a -> b) -> z a -> z b zap (z (b -> c) -> z b -> z c) -> ((a -> b -> c) -> z a -> z (b -> c)) -> (a -> b -> c) -> z a -> z b -> z c forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c) -> z a -> z (b -> c) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b fmap zipWith3 a -> b -> c -> d f = z (c -> d) -> z c -> z d forall (z :: * -> *) a b. Zip z => z (a -> b) -> z a -> z b zap (z (c -> d) -> z c -> z d) -> (z a -> z b -> z (c -> d)) -> z a -> z b -> z c -> z d forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d) -> z a -> z b -> z (c -> d) forall (z :: * -> *) a b c. Zip z => (a -> b -> c) -> z a -> z b -> z c zipWith a -> b -> c -> d f zipWith4 a -> b -> c -> d -> e f z a as = z (d -> e) -> z d -> z e forall (z :: * -> *) a b. Zip z => z (a -> b) -> z a -> z b zap (z (d -> e) -> z d -> z e) -> (z b -> z c -> z (d -> e)) -> z b -> z c -> z d -> z e forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z (d -> e) forall (z :: * -> *) a b c d. Zip z => (a -> b -> c -> d) -> z a -> z b -> z c -> z d zipWith3 a -> b -> c -> d -> e f z a as zipWith5 a -> b -> c -> d -> e -> f f z a as z b bs = z (e -> f) -> z e -> z f forall (z :: * -> *) a b. Zip z => z (a -> b) -> z a -> z b zap (z (e -> f) -> z e -> z f) -> (z c -> z d -> z (e -> f)) -> z c -> z d -> z e -> z f forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z (e -> f) forall (z :: * -> *) a b c d e. Zip z => (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z d -> z e zipWith4 a -> b -> c -> d -> e -> f f z a as z b bs zipWith6 a -> b -> c -> d -> e -> f -> g f z a as z b bs z c cs = z (f -> g) -> z f -> z g forall (z :: * -> *) a b. Zip z => z (a -> b) -> z a -> z b zap (z (f -> g) -> z f -> z g) -> (z d -> z e -> z (f -> g)) -> z d -> z e -> z f -> z g forall c d a b. (c -> d) -> (a -> b -> c) -> a -> b -> d ... (a -> b -> c -> d -> e -> f -> g) -> z a -> z b -> z c -> z d -> z e -> z (f -> g) forall (z :: * -> *) a b c d e f. Zip z => (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z e -> z f zipWith5 a -> b -> c -> d -> e -> f -> g f z a as z b bs z c cs -------------------------------------------------------------------------------- instance Zip [] where zap :: [a -> b] -> [a] -> [b] zap (a -> b f : [a -> b] fs) (a x : [a] xs) = a -> b f a x b -> [b] -> [b] forall a. a -> [a] -> [a] : [a -> b] -> [a] -> [b] forall (z :: * -> *) a b. Zip z => z (a -> b) -> z a -> z b zap [a -> b] fs [a] xs zap [a -> b] _ [a] _ = [] all2 :: (a -> b -> Bool) -> [a] -> [b] -> Bool all2 a -> b -> Bool f (a a:[a] as) (b b:[b] bs) = a -> b -> Bool f a a b b Bool -> Bool -> Bool && (a -> b -> Bool) -> [a] -> [b] -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool all2 a -> b -> Bool f [a] as [b] bs all2 a -> b -> Bool _ [a] _ [b] _ = Bool True all3 :: (a -> b -> c -> Bool) -> [a] -> [b] -> [c] -> Bool all3 a -> b -> c -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) = a -> b -> c -> Bool f a a b b c c Bool -> Bool -> Bool && (a -> b -> c -> Bool) -> [a] -> [b] -> [c] -> Bool forall (z :: * -> *) a b c. Zip z => (a -> b -> c -> Bool) -> z a -> z b -> z c -> Bool all3 a -> b -> c -> Bool f [a] as [b] bs [c] cs all3 a -> b -> c -> Bool _ [a] _ [b] _ [c] _ = Bool True all4 :: (a -> b -> c -> d -> Bool) -> [a] -> [b] -> [c] -> [d] -> Bool all4 a -> b -> c -> d -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) = a -> b -> c -> d -> Bool f a a b b c c d d Bool -> Bool -> Bool && (a -> b -> c -> d -> Bool) -> [a] -> [b] -> [c] -> [d] -> Bool forall (z :: * -> *) a b c d. Zip z => (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z d -> Bool all4 a -> b -> c -> d -> Bool f [a] as [b] bs [c] cs [d] ds all4 a -> b -> c -> d -> Bool _ [a] _ [b] _ [c] _ [d] _ = Bool True all5 :: (a -> b -> c -> d -> e -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> Bool all5 a -> b -> c -> d -> e -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) (e e:[e] es) = a -> b -> c -> d -> e -> Bool f a a b b c c d d e e Bool -> Bool -> Bool && (a -> b -> c -> d -> e -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> Bool forall (z :: * -> *) a b c d e. Zip z => (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z e -> Bool all5 a -> b -> c -> d -> e -> Bool f [a] as [b] bs [c] cs [d] ds [e] es all5 a -> b -> c -> d -> e -> Bool _ [a] _ [b] _ [c] _ [d] _ [e] _ = Bool True all6 :: (a -> b -> c -> d -> e -> f -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> Bool all6 a -> b -> c -> d -> e -> f -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) (e e:[e] es) (f g:[f] gs) = a -> b -> c -> d -> e -> f -> Bool f a a b b c c d d e e f g Bool -> Bool -> Bool && (a -> b -> c -> d -> e -> f -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> Bool forall (z :: * -> *) a b c d e f. Zip z => (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z f -> Bool all6 a -> b -> c -> d -> e -> f -> Bool f [a] as [b] bs [c] cs [d] ds [e] es [f] gs all6 a -> b -> c -> d -> e -> f -> Bool _ [a] _ [b] _ [c] _ [d] _ [e] _ [f] _ = Bool True any2 :: (a -> b -> Bool) -> [a] -> [b] -> Bool any2 a -> b -> Bool f (a a:[a] as) (b b:[b] bs) = a -> b -> Bool f a a b b Bool -> Bool -> Bool || (a -> b -> Bool) -> [a] -> [b] -> Bool forall (z :: * -> *) a b. Zip z => (a -> b -> Bool) -> z a -> z b -> Bool any2 a -> b -> Bool f [a] as [b] bs any2 a -> b -> Bool _ [a] _ [b] _ = Bool False any3 :: (a -> b -> c -> Bool) -> [a] -> [b] -> [c] -> Bool any3 a -> b -> c -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) = a -> b -> c -> Bool f a a b b c c Bool -> Bool -> Bool || (a -> b -> c -> Bool) -> [a] -> [b] -> [c] -> Bool forall (z :: * -> *) a b c. Zip z => (a -> b -> c -> Bool) -> z a -> z b -> z c -> Bool any3 a -> b -> c -> Bool f [a] as [b] bs [c] cs any3 a -> b -> c -> Bool _ [a] _ [b] _ [c] _ = Bool False any4 :: (a -> b -> c -> d -> Bool) -> [a] -> [b] -> [c] -> [d] -> Bool any4 a -> b -> c -> d -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) = a -> b -> c -> d -> Bool f a a b b c c d d Bool -> Bool -> Bool || (a -> b -> c -> d -> Bool) -> [a] -> [b] -> [c] -> [d] -> Bool forall (z :: * -> *) a b c d. Zip z => (a -> b -> c -> d -> Bool) -> z a -> z b -> z c -> z d -> Bool any4 a -> b -> c -> d -> Bool f [a] as [b] bs [c] cs [d] ds any4 a -> b -> c -> d -> Bool _ [a] _ [b] _ [c] _ [d] _ = Bool False any5 :: (a -> b -> c -> d -> e -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> Bool any5 a -> b -> c -> d -> e -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) (e e:[e] es) = a -> b -> c -> d -> e -> Bool f a a b b c c d d e e Bool -> Bool -> Bool || (a -> b -> c -> d -> e -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> Bool forall (z :: * -> *) a b c d e. Zip z => (a -> b -> c -> d -> e -> Bool) -> z a -> z b -> z c -> z d -> z e -> Bool any5 a -> b -> c -> d -> e -> Bool f [a] as [b] bs [c] cs [d] ds [e] es any5 a -> b -> c -> d -> e -> Bool _ [a] _ [b] _ [c] _ [d] _ [e] _ = Bool False any6 :: (a -> b -> c -> d -> e -> f -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> Bool any6 a -> b -> c -> d -> e -> f -> Bool f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) (e e:[e] es) (f g:[f] gs) = a -> b -> c -> d -> e -> f -> Bool f a a b b c c d d e e f g Bool -> Bool -> Bool || (a -> b -> c -> d -> e -> f -> Bool) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> Bool forall (z :: * -> *) a b c d e f. Zip z => (a -> b -> c -> d -> e -> f -> Bool) -> z a -> z b -> z c -> z d -> z e -> z f -> Bool any6 a -> b -> c -> d -> e -> f -> Bool f [a] as [b] bs [c] cs [d] ds [e] es [f] gs any6 a -> b -> c -> d -> e -> f -> Bool _ [a] _ [b] _ [c] _ [d] _ [e] _ [f] _ = Bool False zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] zipWith a -> b -> c f (a a:[a] as) (b b:[b] bs) = a -> b -> c f a a b bc -> [c] -> [c] forall a. a -> [a] -> [a] :(a -> b -> c) -> [a] -> [b] -> [c] forall (z :: * -> *) a b c. Zip z => (a -> b -> c) -> z a -> z b -> z c zipWith a -> b -> c f [a] as [b] bs zipWith a -> b -> c _ [a] _ [b] _ = [] zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] zipWith3 a -> b -> c -> d f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) = a -> b -> c -> d f a a b b c cd -> [d] -> [d] forall a. a -> [a] -> [a] :(a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] forall (z :: * -> *) a b c d. Zip z => (a -> b -> c -> d) -> z a -> z b -> z c -> z d zipWith3 a -> b -> c -> d f [a] as [b] bs [c] cs zipWith3 a -> b -> c -> d _ [a] _ [b] _ [c] _ = [] zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e] zipWith4 a -> b -> c -> d -> e f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) = a -> b -> c -> d -> e f a a b b c c d de -> [e] -> [e] forall a. a -> [a] -> [a] :(a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e] forall (z :: * -> *) a b c d e. Zip z => (a -> b -> c -> d -> e) -> z a -> z b -> z c -> z d -> z e zipWith4 a -> b -> c -> d -> e f [a] as [b] bs [c] cs [d] ds zipWith4 a -> b -> c -> d -> e _ [a] _ [b] _ [c] _ [d] _ = [] zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] zipWith5 a -> b -> c -> d -> e -> f f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) (e e:[e] es) = a -> b -> c -> d -> e -> f f a a b b c c d d e ef -> [f] -> [f] forall a. a -> [a] -> [a] :(a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] forall (z :: * -> *) a b c d e f. Zip z => (a -> b -> c -> d -> e -> f) -> z a -> z b -> z c -> z d -> z e -> z f zipWith5 a -> b -> c -> d -> e -> f f [a] as [b] bs [c] cs [d] ds [e] es zipWith5 a -> b -> c -> d -> e -> f _ [a] _ [b] _ [c] _ [d] _ [e] _ = [] zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] zipWith6 a -> b -> c -> d -> e -> f -> g f (a a:[a] as) (b b:[b] bs) (c c:[c] cs) (d d:[d] ds) (e e:[e] es) (f g:[f] gs) = a -> b -> c -> d -> e -> f -> g f a a b b c c d d e e f gg -> [g] -> [g] forall a. a -> [a] -> [a] :(a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] forall (z :: * -> *) a b c d e f g. Zip z => (a -> b -> c -> d -> e -> f -> g) -> z a -> z b -> z c -> z d -> z e -> z f -> z g zipWith6 a -> b -> c -> d -> e -> f -> g f [a] as [b] bs [c] cs [d] ds [e] es [f] gs zipWith6 a -> b -> c -> d -> e -> f -> g _ [a] _ [b] _ [c] _ [d] _ [e] _ [f] _ = []