Safe Haskell | None |
---|---|
Language | Haskell2010 |
Prednote.Comparisons
Contents
- compareBy :: Show a => Text -> (a -> Ordering) -> Ordering -> Pred a
- compare :: (Show a, Ord a) => a -> Ordering -> Pred a
- equalBy :: Show a => Text -> (a -> Bool) -> Pred a
- equal :: (Eq a, Show a) => a -> Pred a
- compareByMaybe :: Show a => Text -> (a -> Maybe Ordering) -> Ordering -> Pred a
- greater :: (Show a, Ord a) => a -> Pred a
- less :: (Show a, Ord a) => a -> Pred a
- greaterEq :: (Show a, Ord a) => a -> Pred a
- lessEq :: (Show a, Ord a) => a -> Pred a
- notEq :: (Show a, Eq a) => a -> Pred a
- greaterBy :: Show a => Text -> (a -> Ordering) -> Pred a
- lessBy :: Show a => Text -> (a -> Ordering) -> Pred a
- greaterEqBy :: Show a => Text -> (a -> Ordering) -> Pred a
- lessEqBy :: Show a => Text -> (a -> Ordering) -> Pred a
- notEqBy :: Show a => Text -> (a -> Bool) -> Pred a
- compareByM :: (Show a, Functor f) => Text -> (a -> f Ordering) -> Ordering -> PredM f a
- equalByM :: (Show a, Functor f) => Text -> (a -> f Bool) -> PredM f a
- compareByMaybeM :: (Functor f, Show a) => Text -> (a -> f (Maybe Ordering)) -> Ordering -> PredM f a
- greaterByM :: (Show a, Functor f) => Text -> (a -> f Ordering) -> PredM f a
- lessByM :: (Show a, Functor f) => Text -> (a -> f Ordering) -> PredM f a
- greaterEqByM :: (Functor f, Monad f, Show a) => Text -> (a -> f Ordering) -> PredM f a
- lessEqByM :: (Functor f, Monad f, Show a) => Text -> (a -> f Ordering) -> PredM f a
- notEqByM :: (Functor f, Show a) => Text -> (a -> f Bool) -> PredM f a
- parseComparer :: (Monad f, Functor f) => Text -> (Ordering -> PredM f a) -> Maybe (PredM f a)
Comparisions that do not run in a context
Arguments
:: Show a | |
=> Text | Description of the right-hand side |
-> (a -> Ordering) | How to compare the left-hand side to the right-hand side. Return LT if the item is less than the right hand side; GT if greater; EQ if equal to the right hand side. |
-> Ordering | When subjects are compared, this ordering must be the result in order for the Predbox to be True; otherwise it is False. The subject will be on the left hand side. |
-> Pred a |
Arguments
:: (Show a, Ord a) | |
=> a | Right-hand side |
-> Ordering | When subjects are compared, this ordering must be the result in order for the Predbox to be True; otherwise it is False. The subject will be on the left hand side. |
-> Pred a |
Overloaded version of compareBy
.
Arguments
:: Show a | |
=> Text | Description of the right-hand side |
-> (a -> Bool) | How to compare an item against the right hand side. Return
|
-> Pred a |
Builds a Pred
that tests items for equality.
Arguments
:: Show a | |
=> Text | Description of the right-hand side |
-> (a -> Maybe Ordering) | How to compare an item against the right hand side. Return LT if the item is less than the right hand side; GT if greater; EQ if equal to the right hand side. |
-> Ordering | When subjects are compared, this ordering must be the result in order for the Predbox to be True; otherwise it is False. The subject will be on the left hand side. |
-> Pred a |
Builds a Pred
for items that might fail to return a comparison.
Comparisions that run in a context
Arguments
:: (Show a, Functor f) | |
=> Text | Description of the right-hand side |
-> (a -> f Ordering) | How to compare the left-hand side to the right-hand side. Return LT if the item is less than the right hand side; GT if greater; EQ if equal to the right hand side. |
-> Ordering | When subjects are compared, this ordering must be the result in order for the Predbox to be True; otherwise it is False. The subject will be on the left hand side. |
-> PredM f a |
Arguments
:: (Show a, Functor f) | |
=> Text | Description of the right-hand side |
-> (a -> f Bool) | How to compare an item against the right hand side. Return
|
-> PredM f a |
Builds a Pred
that tests items for equality.
Arguments
:: (Functor f, Show a) | |
=> Text | Description of the right-hand side |
-> (a -> f (Maybe Ordering)) | How to compare an item against the right hand side. Return LT if the item is less than the right hand side; GT if greater; EQ if equal to the right hand side. |
-> Ordering | When subjects are compared, this ordering must be the result in order for the Predbox to be True; otherwise it is False. The subject will be on the left hand side. |
-> PredM f a |
Builds a Pred
for items that might fail to return a comparison.
Parsing comparers
Arguments
:: (Monad f, Functor f) | |
=> Text | The string with the comparer to be parsed |
-> (Ordering -> PredM f a) | A function that, when given an ordering, returns a |
-> Maybe (PredM f a) | If an invalid comparer string is given, Nothing; otherwise, the
|
Parses a string that contains text, such as >=
, which indicates
which comparer to use. Returns the comparer.