module Data.Ord.HT where
import Data.Function.HT (compose2, )
{-# INLINE comparing #-}
comparing :: Ord b => (a -> b) -> a -> a -> Ordering
comparing :: forall b a. Ord b => (a -> b) -> a -> a -> Ordering
comparing = forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
compose2 forall a. Ord a => a -> a -> Ordering
compare
{-# INLINE limit #-}
limit :: (Ord a) => (a,a) -> a -> a
limit :: forall a. Ord a => (a, a) -> a -> a
limit (a
l,a
u) = forall a. Ord a => a -> a -> a
max a
l forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Ord a => a -> a -> a
min a
u
{-# INLINE inRange #-}
inRange :: (Ord a) => (a,a) -> a -> Bool
inRange :: forall a. Ord a => (a, a) -> a -> Bool
inRange (a
l,a
u) a
x = a
lforall a. Ord a => a -> a -> Bool
<=a
x Bool -> Bool -> Bool
&& a
xforall a. Ord a => a -> a -> Bool
<=a
u