on master help sign in
Document countWhere
895e6efOllie Charles
src/Rel8/Expr/Aggregate.hs+1
@@ -73,6 +73,7 @@ countStar :: Aggregate (Expr Int64)
73countStar = count (litExpr True)
73countStar = count (litExpr True)
74
74
75
75
76+-- | A count of the number of times a given expression is @true@.
76countWhere :: Expr Bool -> Aggregate (Expr Int64)
77countWhere :: Expr Bool -> Aggregate (Expr Int64)
77countWhere condition = count (caseExpr [(condition, litExpr (Just True))] null)
78countWhere condition = count (caseExpr [(condition, litExpr (Just True))] null)
78
79