Reason
  • Docs
  • Try
  • API
  • Community
  • Blog
  • Languages iconEnglish
    • 日本語
    • Deutsch
    • Español
    • Français
    • 한국어
    • Português (Brasil)
    • Русский
    • Українська
    • 中文
    • 繁體中文
    • Help Translate
  • GitHub
Previous  Up  Next

Module Sort

module Sort: sig .. end
Deprecated.This module is obsolete and exists only for backward compatibility. The sorting functions in Array and List should be used instead. The new functions are faster and use less memory.
Sorting and merging lists.

let list: (('a, 'a) => bool, list('a)) => list('a);
Sort a list in increasing order according to an ordering predicate. The predicate should return true if its first argument is less than or equal to its second argument.
let array: (('a, 'a) => bool, array('a)) => unit;
Sort an array in increasing order according to an ordering predicate. The predicate should return true if its first argument is less than or equal to its second argument. The array is sorted in place.
let merge: (('a, 'a) => bool, list('a), list('a)) => list('a);
Merge two lists according to the given predicate. Assuming the two argument lists are sorted according to the predicate, merge returns a sorted list containing the elements from the two lists. The behavior is undefined if the two argument lists were not sorted.