Logo

Programming-Idioms

History of Idiom 13 > diff from v41 to v42

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

Version 41

2016-02-17, 22:55:04

Version 42

2016-02-18, 16:57:56

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
(doseq [k {:a "x" :b "y" :c "z"}] (prn k))
Imports
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Hash;

use Ada.Containers;
Code
for C in My_Map.Iterate loop
   Put_Line ("Key = " & Key (C) & ", Value = " & Element (C));
end loop;
Code
mapM_ print mymap
Code
mapM_ print mymap