equal
deleted
inserted
replaced
285 (* tables with multiple entries per key (preserving order) *) |
285 (* tables with multiple entries per key (preserving order) *) |
286 |
286 |
287 fun lookup_multi tab_key = getOpt (lookup tab_key,[]); |
287 fun lookup_multi tab_key = getOpt (lookup tab_key,[]); |
288 fun update_multi ((key, x), tab) = update ((key, x :: lookup_multi (tab, key)), tab); |
288 fun update_multi ((key, x), tab) = update ((key, x :: lookup_multi (tab, key)), tab); |
289 |
289 |
290 fun make_multi pairs = Library.foldr update_multi (pairs, empty); |
290 fun make_multi pairs = foldr update_multi empty pairs; |
291 fun dest_multi tab = List.concat (map (fn (key, xs) => map (Library.pair key) xs) (dest tab)); |
291 fun dest_multi tab = List.concat (map (fn (key, xs) => map (Library.pair key) xs) (dest tab)); |
292 fun merge_multi eq tabs = join (fn (xs, xs') => SOME (gen_merge_lists eq xs xs')) tabs; |
292 fun merge_multi eq tabs = join (fn (xs, xs') => SOME (gen_merge_lists eq xs xs')) tabs; |
293 fun merge_multi' eq tabs = join (fn (xs, xs') => SOME (gen_merge_lists' eq xs xs')) tabs; |
293 fun merge_multi' eq tabs = join (fn (xs, xs') => SOME (gen_merge_lists' eq xs xs')) tabs; |
294 |
294 |
295 |
295 |