utility-ht-0.0.17: Various small helper functions for Lists, Maybes, Tuples, Functions
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Ord.HT

Synopsis

Documentation

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

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

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

Called clamp elsewhere.

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

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