The ArrayQSortFn functor

The ArrayQSortFn functor provides in situ sorting of monomorphic arrays using the quicksort algorithm.

Synopsis

signature MONO_ARRAY_SORT
functor ArrayQSortFn (A : MONO_ARRAY) : MONO_ARRAY_SORT

Functor Argument Interface

A : MONO_ARRAY

Functor Argument Description

A : MONO_ARRAY

A structure that implements the MONO_ARRAY signature from the SML Basis Library.

Interface

structure A : MONO_ARRAY

val sort : (A.elem * A.elem -> order) -> A.array -> unit

val sorted : (A.elem * A.elem -> order) -> A.array -> bool

Interface Description

structure A : MONO_ARRAY

The argument structure.

val sort : (A.elem * A.elem -> order) -> A.array -> unit

sort cmp arr sorts the array arr into ascending order according to the comparison function cmp.

val sorted : (A.elem * A.elem -> order) -> A.array -> bool

sorted cmp arr returns true if, and only if, the array arr= is sorted in ascending order.