.TH "Sort" 3o source: 2019-01-25 OCamldoc "OCaml library" .SH NAME Sort \- Sorting and merging lists. .SH Module Module Sort .SH Documentation .sp Module .BI "Sort" : .B sig end .sp .B "Deprecated." This module is obsolete and exists only for backward compatibility\&. The sorting functions in .B Array and .B List should be used instead\&. The new functions are faster and use less memory\&. .sp Sorting and merging lists\&. .sp .sp .sp .I val list : .B ('a -> 'a -> bool) -> 'a list -> 'a list .sp Sort a list in increasing order according to an ordering predicate\&. The predicate should return .B true if its first argument is less than or equal to its second argument\&. .sp .I val array : .B ('a -> 'a -> bool) -> 'a array -> unit .sp Sort an array in increasing order according to an ordering predicate\&. The predicate should return .B true if its first argument is less than or equal to its second argument\&. The array is sorted in place\&. .sp .I val merge : .B ('a -> 'a -> bool) -> 'a list -> 'a list -> 'a list .sp Merge two lists according to the given predicate\&. Assuming the two argument lists are sorted according to the predicate, .B merge returns a sorted list containing the elements from the two lists\&. The behavior is undefined if the two argument lists were not sorted\&. .sp