[MLton] bool array size

Henry Cejtin henry.cejtin@sbcglobal.net
Thu, 16 Mar 2006 18:05:16 -0600


The code just tabulated an array using the function
	fn i => { key = MLton.Random.rand () mod 0w3,
		  ord = i }
and then did a quick sort of the array using the comparison function
	fun cmp ({ key = lhs, ... }, { key = rhs, ... }) =
	       (cnt := !cnt + 1
		; lhs <= rhs)
and then did a pass through the array making sure that it was sorted (not
using the cmp function) and that all elements where present (by setting a
bool array so that the ord indicies were true, also checking that there were
no duplicates).  The only place where there was an array subscript/update
without selecting the components was in the quick sort.