| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Predicate.Data.Ordering
Description
promoted Ordering functions
Synopsis
- data p > q
- data p >= q
- data p == q
- data p /= q
- data p <= q
- data p < q
- data p >~ q
- data p >=~ q
- data p ==~ q
- data p /=~ q
- data p <=~ q
- data p <~ q
- data Gt n
- data Ge n
- data Same n
- data Le n
- data Lt n
- data Ne n
- data p ==! q
- data OrdA' p q
- data OrdA
- data p ===~ q
- data Cmp (o :: OrderingP) p q
- data CmpI (o :: OrderingP) p q
- data Asc
- data Asc'
- data Desc
- data Desc'
- data AllPositive
- data Positive
- data AllNegative
- data Negative
Documentation
compare if expression p is greater than q
>>>pl @(Id > "xx") "abc"False ("abc" > "xx") Val False
>>>pl @(Id > "aa") "abc"True ("abc" > "aa") Val True
>>>pl @(Fst > Snd) (True,False)True (True > False) Val True
compare if expression p is greater than or equal to q
compare if expression p is equal to q
>>>pl @(Fst == Snd) ("ab","xyzabw")False ("ab" == "xyzabw") Val False
>>>pl @(Fst == Snd) ("aBc","AbC")False ("aBc" == "AbC") Val False
>>>pz @(Fst == Snd) ("aBc","aBc")Val True
>>>pl @(Id == "Abc") "abc"False ("abc" == "Abc") Val False
>>>pl @(Fst == Snd) (True,False)False (True == False) Val False
>>>pl @(Not Id *** Id >> Fst == Snd) (True,False)True ((>>) True | {False == False}) Val True
compare if expression p is not equal to q
>>>pl @(Fst /= Snd) ("ab","xyzabw")True ("ab" /= "xyzabw") Val True
compare if expression p is less than or equal to q
>>>pl @(Not (Fst >> Len <= 6)) ([2..7],True)False (Not ((>>) True | {6 <= 6})) Val False
>>>pl @(Fst >> Len <= 6) ([2..7],True)True ((>>) True | {6 <= 6}) Val True
>>>pl @(Length Fst <= 6) ([2..7],True)True (6 <= 6) Val True
>>>pl @(Fst >> (Len <= 6)) ([2..7],True)True ((>>) True | {6 <= 6}) Val True
compare if expression p is less than q
case-insensitive compare if string expression p is greater than q
case-insensitive compare if string expression p is greater than or equal to q
case-insensitive compare if string expression p is equal to q
case-insensitive compare if string expression p is not equal to q
case-insensitive compare if string expression p is less than or equal to q
case-insensitive compare if string expression p is less than q
compare if expression p is greater than q
>>>pl @(Gt 4) 5True (5 > 4) Val True
compare if expression p is greater than or equal to q
compare if expression p is equal to q
compare if expression p is less than or equal to q
compare if expression p is less than to q
compare if expression p is not equal to q
similar to compare
>>>pz @(Fst ==! Snd) (10,9)Val GT
>>>pz @(14 % 3 ==! Fst -% Snd) (-10,7)Val GT
>>>pz @(Fst ==! Snd) (10,11)Val LT
>>>pz @(Snd ==! (L12 >> Head)) (('x',[10,12,13]),10)Val EQ
>>>pl @("aa" ==! Id) "aaaa"Present LT ((==!) "aa" < "aaaa") Val LT
>>>pl @(Pairs >> Map (First (Succ >> Succ) >> Fst ==! Snd)) [1,2,3,6,8]Present [GT,GT,LT,EQ] ((>>) [GT,GT,LT,EQ] | {Map [GT,GT,LT,EQ] | [(1,2),(2,3),(3,6),(6,8)]}) Val [GT,GT,LT,EQ]
>>>pl @((Ones << ShowP Id) >> Map' (Fst ==! Snd) Pairs) 1234223Present [LT,LT,LT,GT,EQ,LT] ((>>) [LT,LT,LT,GT,EQ,LT] | {Map [LT,LT,LT,GT,EQ,LT] | [("1","2"),("2","3"),("3","4"),("4","2"),("2","2"),("2","3")]}) Val [LT,LT,LT,GT,EQ,LT]
>>>pl @("Abc" ==! Id) "abc"Present LT ((==!) "Abc" < "abc") Val LT
>>>pl @(Fst ==! Snd) (3,12)Present LT ((==!) 3 < 12) Val LT
>>>pl @(Fst ==! Snd) ("aBc","AbC")Present GT ((==!) "aBc" > "AbC") Val GT
>>>pl @(Snd ==! Fst) ("aBc","AbC")Present LT ((==!) "AbC" < "aBc") Val LT
similar to compare but using a tuple as input
data p ===~ q infix 4 Source #
compare two strings ignoring case and return an ordering
>>>pz @(Fst ===~ Snd) ("abC","aBc")Val EQ
>>>pz @(Fst ===~ Snd) ("abC","DaBc")Val LT
>>>pl @(Fst ===~ Snd &&& Fst ==! Snd) ("abc","abc")Present (EQ,EQ) ('(EQ,EQ)) Val (EQ,EQ)
>>>pl @(Fst ===~ Snd) ("aBc","AbC")Present EQ ((===~) aBc = AbC) Val EQ
>>>pl @("Abc" ===~ Id) "abc"Present EQ ((===~) Abc = abc) Val EQ
>>>pl @("Abc" ==~ Id) "abc"True (Abc ==~ abc) Val True
>>>pl @(Fst ==~ Snd) ("aBc","AbC")True (aBc ==~ AbC) Val True
>>>pl @(Fst ==~ Snd && Fst == Snd) ("Abc","Abc")True (True && True) Val True
data Cmp (o :: OrderingP) p q Source #
compare two values using the given ordering o
>>>pl @(Lt 4) 123False (123 < 4) Val False
>>>pl @(Lt 4) 1True (1 < 4) Val True
>>>pl @(Negate 7 <..> 20) (-4)True (-7 <= -4 <= 20) Val True
>>>pl @(Negate 7 <..> 20) 21False (21 <= 20) Val False
data CmpI (o :: OrderingP) p q Source #
compare two strings ignoring case using the given ordering o
a type level predicate for a monotonic increasing list
>>>pl @Asc "aaacdef"True ((>>) True | {All(6)}) Val True
>>>pz @Asc [1,2,3,4,5,5,7]Val True
>>>pz @Asc "axacdef"Val False
a type level predicate for a strictly increasing list
>>>pz @Asc' [1,2,3,4,5,5,7]Val False
>>>pz @Asc' []Val True
>>>pz @Asc' [-10]Val True
a type level predicate for a monotonic decreasing list
a type level predicate for a strictly decreasing list
data AllPositive Source #
a type level predicate for all positive elements in a list
>>>pz @AllPositive [1,5,10,2,3]Val True
>>>pz @AllPositive [0,1,5,10,2,3]Val False
>>>pz @AllPositive [3,1,-5,10,2,3]Val False
Instances
| Show AllPositive Source # | |
Defined in Predicate.Data.Ordering Methods showsPrec :: Int -> AllPositive -> ShowS # show :: AllPositive -> String # showList :: [AllPositive] -> ShowS # | |
| P AllPositiveT x => P AllPositive x Source # | |
Defined in Predicate.Data.Ordering Associated Types type PP AllPositive x Source # Methods eval :: MonadEval m => proxy AllPositive -> POpts -> x -> m (TT (PP AllPositive x)) Source # | |
| type PP AllPositive x Source # | |
Defined in Predicate.Data.Ordering | |
a type level predicate for a positive number
data AllNegative Source #
a type level predicate for all negative elements in a list
>>>pz @AllNegative [-1,-5,-10,-2,-3]Val True
Instances
| Show AllNegative Source # | |
Defined in Predicate.Data.Ordering Methods showsPrec :: Int -> AllNegative -> ShowS # show :: AllNegative -> String # showList :: [AllNegative] -> ShowS # | |
| P AllNegativeT x => P AllNegative x Source # | |
Defined in Predicate.Data.Ordering Associated Types type PP AllNegative x Source # Methods eval :: MonadEval m => proxy AllNegative -> POpts -> x -> m (TT (PP AllNegative x)) Source # | |
| type PP AllNegative x Source # | |
Defined in Predicate.Data.Ordering | |