Loop over multiple arrays simultaneously: Difference between revisions

m
→‎{{header|Haskell}}: ZipList version tidied for legibility
m (→‎{{header|Haskell}}: ZipList version tidied for legibility)
Line 1,786:
 
ZipLists generalize zipWith to any number of parameters
<lang haskell>import Control.Applicative (ZipList (ZipList, getZipList))
 
main = sequence $ getZipList $ (\x y z -> putStrLn [x, y, z]) <$> ZipList "abd" <*> ZipList "ABC" <*> ZipList "123"</lang>
main :: IO [()]
main =
sequence $
getZipList $
(\x y z -> putStrLn [x, y, z])
<$> ZipList "abd"
<*> ZipList "ABC"
<*> ZipList "123"</lang>
 
=={{header|Haxe}}==
9,659

edits