RosettaCodeData/Task/Hash-from-two-arrays/Standard-ML/hash-from-two-arrays-1.ml
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

10 lines
382 B
Standard ML

structure StringMap = BinaryMapFn (struct
type ord_key = string
val compare = String.compare
end);
val keys = [ "foo", "bar", "baz" ]
and vals = [ 16384, 32768, 65536 ]
and myMap = StringMap.empty;
val myMap = foldl StringMap.insert' myMap (ListPair.zipEq (keys, vals));