red-g/sort/1.0.1

Sort

Useful ways to combine sorters.

type Sorter a

A sorter which produces an Order between values.

all : List (Sorter a) -> Sorter a

Combine a list of sorters, defering to those earlier in the list.

and : Sorter a -> Sorter a -> Sorter a

Combine sorters, deferring to the second sorter.

by : (b -> a) -> Sorter a -> Sorter b

Sort by a derived property.

custom : (a -> a -> Order) -> Sorter a

For when you need to handroll a sorter!

A sorter that always returns EQ.

float : Sorter Float

Sort floats in increasing order.

int : Sorter Int

Sort integers in increasing order.

list : Sorter a -> List a -> List a

Order a list with given sorter.

order : Sorter a -> a -> a -> Order

Order two elements according to a sorter.

Reverse the order of a sorter.

string : Sorter String

Sort strings alphabetically.