~._build._order

trait _order
class Object
trait Matchable
class Any
trait _build
object ~

Def

inline def sort[A](using inline o: Ordering[A]): ~[A]

Sort

Sort

Sorts stream elements with given Ordering

  ~~(5, 1, 4, 2, 3).sort.tp  // Prints ~(1, 2, 3, 4, 5)
Source
_order.scala
inline def sortBy[A](inline f: A => B)(using inline o: Ordering[B]): ~[A]

Sort by property

Sort by property

Sorts stream of elements based on a single property

  ~~("aaaa", "bb", "ccc", "d").sortBy(_.length).tp

  // Output
  ~(d, bb, ccc, aaaa)
Source
_order.scala
inline def sortBy[A](f1: A => B, f2: A => C)(using Ordering[B], Ordering[C]): ~[A]

Sort by two properties

Sort by two properties

Sorts stream on first property, and then, if indeterminate on second

Source
_order.scala
inline def sortBy[A](f1: A => B, f2: A => C, f3: A => D)(using Ordering[B], Ordering[C], Ordering[D]): ~[A]

Sort by three properties

Sort by three properties

Sorts stream on first property, then if indeterminate on second, etc...

Source
_order.scala
inline def sortReversed[A](using inline o: Ordering[A]): ~[A]

Sort reversed

Sort reversed

Reverse sorts stream elements with given Ordering

  ~~(5, 1, 4, 2, 3).sortReversed.tp  // Prints ~(5, 4, 3, 2, 1)
Source
_order.scala