Given a range and a value it will tell you wether or not the value is
in the range. Remember that all ranges are inclusive.
The primary value of this library is performance and this method can
be used to show this quite clearly. For example, you can try and
approximate basic range functionality with "Data.List.elem" so we can
generate an apples to apples comparison in GHCi:
>>> :set +s
>>> elem (10000000 :: Integer) [1..10000000]
True
(0.26 secs, 720,556,888 bytes)
>>> inRange (1 +=+ 10000000) (10000000 :: Integer)
True
(0.00 secs, 557,656 bytes)
>>>
As you can see, this function is significantly more performant, in
both speed and memory, than using the elem function.