krisajenkins/elm-exts/26.1.1

NOTE: this package is not compatible with Elm 0.19.1

Exts.Basics

Extensions to the core Basics library.

compareBy : (a -> comparable) -> a -> a -> Order

Like Basics.compare, with a custom function. For example:

compareBy Date.toTime earlyDate laterDate
--> LT
maxBy : (a -> comparable) -> a -> a -> a

Like Basics.max, but it works on non-comparable types by taking a custom function. For example:

maxBy Date.toTime earlyDate laterDate
--> laterDate
minBy : (a -> comparable) -> a -> a -> a

Like Basics.min, but it works on non-comparable types by taking a custom function. For example:

minBy Date.toTime earlyDate laterDate
--> earlyDate