functor export new:NewDict put:Put condGet:CondGet entries:Entries define fun {NewDict} leaf end fun {Put Ds Key Value} case Ds of leaf then tree(Key Value leaf leaf) [] tree(K _ L R) andthen K==Key then tree(K Value L R) [] tree(K V L R) andthen K>Key then tree(K V {Put L Key Value} R) [] tree(K V L R) andthen KKey then {CondGet L Key Default} [] tree(K _ _ R) andthen K