Open koraa opened 3 years ago
We should provide functions for traversing trees make from containers that implement Get/Set
const treeGet = (seq, tree) => foldl(seq, tree, (c, k) => get(c, k)); const treeSet = (seq, tree, value) =>… const tryTreeGet = (seq, tree, default) => // Returns default if a node didn't exist const tryTreeSet = (seq, tree, value) => // Won't throw an exception if an intermediate node didn't exist const treeCreateNodes = (seq, tree) => // Will create intermediate nodes (default values in sequence which is of the form [[key, defaultValue],...])
We should provide functions for traversing trees make from containers that implement Get/Set