diff options
author | dan <[email protected]> | 2024-04-20 19:43:40 -0400 |
---|---|---|
committer | dan <[email protected]> | 2024-04-20 19:43:40 -0400 |
commit | 15bb4b35de62205b4cd077ed4d8efcf1cc0ebd39 (patch) | |
tree | a0b251975fd355e735080b10b85182e9c8ba5766 | |
parent | e43a960667914a46d671c9cf1801a53d26385568 (diff) | |
download | bizexp-master.tar.gz bizexp-master.tar.bz2 bizexp-master.zip |
-rwxr-xr-x | src/BizExpr.hs | 8 |
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) |