aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/BizExpr.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/BizExpr.hs b/src/BizExpr.hs
index b11ffc1..b199c15 100755
--- a/src/BizExpr.hs
+++ b/src/BizExpr.hs
@@ -119,8 +119,16 @@ getFunc "sum" = Just eSum
getFunc "any" = Just eAny
getFunc "all" = Just eAll
getFunc "average" = Just eAverage
+getFunc "floor" = Just eFloor
+getFunc "not" = Just eNot
getFunc _ = Nothing
+eFloor :: [Value] -> Maybe Value
+eFloor (v:_) = IntVal <$> (floor <$> (coerceTo v :: Maybe Float))
+
+eNot :: [Value] -> Maybe Value
+eNot (v:_) = BoolVal <$> (not <$> coerceTo v)
+
eSum :: [Value] -> Maybe Value
eSum = eFold (+) (0.0 :: Float)