summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-09-18 21:22:51 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-09-18 21:22:51 +0200
commit0a51c798d1322297f13ce6bc7a500ce5212b5e8e (patch)
treee77b299382259a4c8686e6243b17b1f4924af051
parentcf508f90bc3c51ef01de1f66226d8168cb1630fe (diff)
Greater-then/less-then comparison operators for numbers
Changelog: Added `>`, `>=`, `<=` and `<` operators for numbers
-rw-r--r--src/Parser/Expr.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Parser/Expr.hs b/src/Parser/Expr.hs
index 835c58d..f9b1e32 100644
--- a/src/Parser/Expr.hs
+++ b/src/Parser/Expr.hs
@@ -245,6 +245,22 @@ someExpr = join inner <?> "expression"
, SomeBinOp ((/=) @Scientific)
, SomeBinOp ((/=) @Text)
]
+ , binary ">" $
+ [ SomeBinOp ((>) @Integer)
+ , SomeBinOp ((>) @Scientific)
+ ]
+ , binary ">=" $
+ [ SomeBinOp ((>=) @Integer)
+ , SomeBinOp ((>=) @Scientific)
+ ]
+ , binary "<=" $
+ [ SomeBinOp ((<=) @Integer)
+ , SomeBinOp ((<=) @Scientific)
+ ]
+ , binary "<" $
+ [ SomeBinOp ((<) @Integer)
+ , SomeBinOp ((<) @Scientific)
+ ]
]
]