Loop over multiple arrays simultaneously: Difference between revisions
Loop over multiple arrays simultaneously (view source)
Revision as of 15:37, 16 July 2022
, 1 year ago→{{header|Haskell}}: ZipList version tidied for legibility
(→C++23) |
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 :: IO [()]
main =
sequence $
getZipList $
(\x y z -> putStrLn [x, y, z])
<$> ZipList "abd"
<*> ZipList "ABC"
<*> ZipList "123"</lang>
=={{header|Haxe}}==
|