RosettaCodeData/Task/Hash-from-two-arrays/Standard-ML/hash-from-two-arrays-1.ml
2023-07-01 13:44:08 -04: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));