on master help sign in
Document countWhere
commit895e6ef4bad873a9ee760327a959ad862aa16989 authorOllie Charles <ollie@ocharles.org.uk> dateWed 24 Mar 2021, 13:22 (6 years ago) parentfd41751
1 file changed+1
src/Rel8/Expr/Aggregate.hs+1
src/Rel8/Expr/Aggregate.hs+1
@@ -73,6 +73,7 @@ countStar :: Aggregate (Expr Int64)
7373countStar = count (litExpr True)
7474
7575
76+-- | A count of the number of times a given expression is @true@.
7677countWhere :: Expr Bool -> Aggregate (Expr Int64)
7778countWhere condition = count (caseExpr [(condition, litExpr (Just True))] null)
7879