Data.Ord.HT

utility-ht-0.0.12: Various small helper functions for Lists, Maybes, Tuples, Functions

Safe Haskell | Safe
Language | Haskell98

Data.Ord.HT

Synopsis

- comparing :: Ord b => (a -> b) -> a -> a -> Ordering
- limit :: Ord a => (a, a) -> a -> a
- inRange :: Ord a => (a, a) -> a -> Bool

# Documentation

comparing :: Ord b => (a -> b) -> a -> a -> Ordering #

limit :: Ord a => (a, a) -> a -> a #

`limit (lower,upper) x` restricts `x` to the range from `lower` to `upper`. Don't expect a sensible result for `lower>upper`.

inRange :: Ord a => (a, a) -> a -> Bool #

`limit (lower,upper) x` checks whether `x` is in the range from `lower` to `upper`. Don't expect a sensible result for `lower>upper`.