/** * Constructs a new tree from an iterable of key-value pairs. * * @tsplus static RedBlackTree.Ops from */ export function from( ord: Ord ): ( data: Collection ) => RedBlackTree { return ( data: Collection ) => { let tree = RedBlackTree.empty(ord) for (const [k, v] of data) { tree = tree.insert(k, v) } return tree } }