I want to create an ordered map with multiples nodes in SML . All i have found until now , exist here : https://www.smlnj.org/doc/smlnj-lib/Manual/binary-map-fn.html . So , i am trying something like this :
structure S = BinaryMapFn(struct
type ord_key = int
val compare = Int.compare
end);
and then , i am trying to insert for example 2 nodes with value 0 and key values 1 and 2 , respectively :
S.insert(S.empty,1,0);
S.insert(S.empty,2,0);
output:val it = T {cnt=1,key=2,left=E,right=E,value=0} : int S.map
S.numItems(it);
output:val it = 1 : int
So, i am assuming by the output of numItems that it creates 2 binary maps with 1 node each and not a single one . I am pretty sure i am missing something , but there is not enough material and examples related to that structure .