prednote-0.26.0.2

Safe HaskellSafe-Inferred

Prednote.Comparisons

Synopsis

Documentation

compareBySource

Arguments

:: Text

Description of the type of thing that is being matched

-> Text

Description of the right-hand side

-> (a -> Text)

Describes the left-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 

Build a Pred that compares items. The idea is that the item on the right hand side is baked into the Pred and that the Pred compares this single right-hand side to each left-hand side item.

compareSource

Arguments

:: (Show a, Ord a) 
=> Text

Description of the type of thing that is being matched

-> 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.

equalBySource

Arguments

:: Text

Description of the type of thing that is being matched

-> Text

Description of the right-hand side

-> (a -> Text)

Describes the left-hand side

-> (a -> Bool)

How to compare an item against the right hand side. Return True if the items are equal; False otherwise.

-> Pred a 

Builds a Pred that tests items for equality.

equalSource

Arguments

:: (Eq a, Show a) 
=> Text

Description of the type of thing that is being matched

-> a

Right-hand side

-> Pred a 

Overloaded version of equalBy.

compareByMaybeSource

Arguments

:: Text

Description of the type of thing that is being matched

-> Text

Description of the right-hand side

-> (a -> Text)

Describes the left-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.

greaterSource

Arguments

:: (Show a, Ord a) 
=> Text

Description of the type of thing being matched

-> a

Right-hand side

-> Pred a 

lessSource

Arguments

:: (Show a, Ord a) 
=> Text

Description of the type of thing being matched

-> a

Right-hand side

-> Pred a 

greaterEqSource

Arguments

:: (Show a, Ord a) 
=> Text

Description of the type of thing being matched

-> a

Right-hand side

-> Pred a 

lessEqSource

Arguments

:: (Show a, Ord a) 
=> Text

Description of the type of thing being matched

-> a

Right-hand side

-> Pred a 

notEqSource

Arguments

:: (Show a, Eq a) 
=> Text

Description of the type of thing being matched

-> a

Right-hand side

-> Pred a 

greaterBySource

Arguments

:: Text

Description of the type of thing being matched

-> Text

Description of right-hand side

-> (a -> Text)

Describes the left-hand side

-> (a -> 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.

-> Pred a 

lessBySource

Arguments

:: Text

Description of the type of thing being matched

-> Text

Description of right-hand side

-> (a -> Text)

Describes the left-hand side

-> (a -> 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.

-> Pred a 

greaterEqBySource

Arguments

:: Text

Description of the type of thing being matched

-> Text

Description of right-hand side

-> (a -> Text)

Describes the left-hand side

-> (a -> 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.

-> Pred a 

lessEqBySource

Arguments

:: Text

Description of the type of thing being matched

-> Text

Description of right-hand side

-> (a -> Text)

Describes the left-hand side

-> (a -> 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.

-> Pred a 

notEqBySource

Arguments

:: Text

Description of the type of thing being matched

-> Text

Description of right-hand side

-> (a -> Text)

Describes the left-hand side

-> (a -> Bool)

How to compare an item against the right hand side. Return True if equal; False otherwise.

-> Pred a 

parseComparerSource

Arguments

:: Text

The string with the comparer to be parsed

-> (Ordering -> Pred a)

A function that, when given an ordering, returns a Pred. Typically you will get this by partial application of compare, compareBy, or compareByMaybe.

-> Maybe (Pred a)

If an invalid comparer string is given, Nothing; otherwise, the Pred.

Parses a string that contains text, such as >=, which indicates which comparer to use. Returns the comparer.