diff --git a/fcore/search-list/dfa-gen.sml b/fcore/search-list/dfa-gen.sml index 2a73655..6a02e54 100644 --- a/fcore/search-list/dfa-gen.sml +++ b/fcore/search-list/dfa-gen.sml @@ -109,6 +109,16 @@ struct BRANCH (l, newKey, newVal, r) | LEAF => BRANCH (LEAF, newKey, newVal, LEAF) + fun addFromList (lst, tree) = + case lst of + [] => tree + | (k, v) :: tl => + let + val tree = insertOrReplace (k, v, tree) + in + addFromList (tl, tree) + end + fun getOrDefault (findKey, tree, default) = case tree of BRANCH (l, curKey, curVal, r) =>