danielnarey/elm-toolkit/6.2.0

NOTE: this package is not compatible with Elm 0.19.1

Toolkit.Compare

Helpers for comparing values

Intervals

isInRange : ( comparable, comparable ) -> comparable -> Bool

Given an interval and a test value, returns True if the test value falls within the interval, including its endpoints

10
  |> Toolkit.Compare.isInRange (10, 20)


--> True
isBetween : ( comparable, comparable ) -> comparable -> Bool

Given an interval and a test value, returns True if the test value falls strictly between the endpoints of the interval, such that a test value equal to one of the endpoints will return False

10
  |> Toolkit.Compare.isBetween (10, 20)


--> False