Associative array/Creation: Difference between revisions

m (Moved to Basic learning cat)
Line 303:
===Binary tree===
A simple idiom to create a persistent binary tree mapping strings to integers:
Modulemodule StringMap = Map.Make(String);;
let map = StringMap.empty;;
let map = List.fold_left (fun map (key, value) -> StringMap.add key value map)
Anonymous user