Logo

Programming-Idioms

History of Idiom 13 > diff from v36 to v37

Edit summary for version 37 by :
[Haskell] Less duplication

Version 36

2016-02-17, 10:57:53

Version 37

2016-02-17, 12:00:57

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Code
sequence_ [ print (k,x) | (k,x) <- mymap ]
 
Code
mapM_ print mymap