on master help sign in
Now that we have `orderTabulation`, I'm not sure we need `listAggWithOrder` and friends
commitbdb75e65807599dbf63ac2f4c36cb4ae16b84b43 authorShane O'Brien <shane.obrien@circuithub.com> dateMon 14 Jun 2021, 11:53 (5 years ago) parentdb40580
3 files changed+2−47
src/Rel8.hs+2−2 src/Rel8/Expr/Aggregate.hs−25 src/Rel8/Table/Aggregate.hs−20
src/Rel8.hs+2−2
@@ -219,8 +219,8 @@ module Rel8
219219 , groupBy
220220 , headAgg
221221 , array1DAggExpr
222− , listAgg, listAggWithOrder, listAggExpr
223− , nonEmptyAgg, nonEmptyAggWithOrder, nonEmptyAggExpr
222+ , listAgg, listAggExpr
223+ , nonEmptyAgg, nonEmptyAggExpr
224224 , DBMax, max
225225 , DBMin, min
226226 , DBSum, sum, sumWhere
src/Rel8/Expr/Aggregate.hs−25
@@ -14,7 +14,6 @@ module Rel8.Expr.Aggregate
1414 , groupByExpr
1515 , headAggExpr
1616 , array1DAggExpr, listAggExpr, nonEmptyAggExpr
17− , listAggExprWithOrder, nonEmptyAggExprWithOrder
1817 )
1918where
2019
@@ -38,7 +37,6 @@ import Rel8.Expr.Opaleye
3837 )
3938import Rel8.Expr.Null ( null )
4039import Rel8.Expr.Serialize ( litExpr )
41−import Rel8.Order ( Order, toOrderExprs )
4240import Rel8.Schema.Null ( Sql )
4341import Rel8.Type.Array ( fromPrimArray )
4442import Rel8.Type.Array1D ( Array1D, NotArray )
@@ -202,26 +200,3 @@ nonEmptyAggExpr = unsafeMakeAggregate toPrimExpr from $ Just
202200 }
203201 where
204202 from = fromPrimExpr . fromPrimArray
205−
206−
207−listAggExprWithOrder :: Order o -> o -> Expr a -> Aggregate (Expr [a])
208−listAggExprWithOrder order o = unsafeMakeAggregate toPrimExpr from $ Just
209− Aggregator
210− { operation = Opaleye.AggrArr
211− , ordering = toOrderExprs order o
212− , distinction = Opaleye.AggrAll
213− }
214− where
215− from = fromPrimExpr . fromPrimArray
216−
217−
218−nonEmptyAggExprWithOrder :: ()
219− => Order o -> o -> Expr a -> Aggregate (Expr (NonEmpty a))
220−nonEmptyAggExprWithOrder order o = unsafeMakeAggregate toPrimExpr from $ Just
221− Aggregator
222− { operation = Opaleye.AggrArr
223− , ordering = toOrderExprs order o
224− , distinction = Opaleye.AggrAll
225− }
226− where
227− from = fromPrimExpr . fromPrimArray
src/Rel8/Table/Aggregate.hs−20
@@ -8,7 +8,6 @@ module Rel8.Table.Aggregate
88 ( groupBy
99 , headAgg
1010 , listAgg, nonEmptyAgg
11− , listAggWithOrder, nonEmptyAggWithOrder
1211 )
1312where
1413
@@ -23,11 +22,8 @@ import Rel8.Expr.Aggregate
2322 ( groupByExpr
2423 , headAggExpr
2524 , listAggExpr
26− , listAggExprWithOrder
2725 , nonEmptyAggExpr
28− , nonEmptyAggExprWithOrder
2926 )
30−import Rel8.Order ( Order )
3127import Rel8.Schema.Dict ( Dict( Dict ) )
3228import Rel8.Schema.HTable ( hfield, hmap, htabulate )
3329import Rel8.Schema.HTable.Vectorize ( hvectorize )
@@ -80,19 +76,3 @@ nonEmptyAgg (toColumns -> exprs) = fromColumns $
8076 hvectorize
8177 (\_ (Identity (E a)) -> A $ nonEmptyAggExpr a)
8278 (pure exprs)
83−
84−
85−listAggWithOrder :: Table Expr a
86− => Order o -> o -> a -> Aggregate (ListTable a)
87−listAggWithOrder order o (toColumns -> exprs) = fromColumns $
88− hvectorize
89− (\_ (Identity (E x)) -> A $ listAggExprWithOrder order o x)
90− (pure exprs)
91−
92−
93−nonEmptyAggWithOrder :: Table Expr a
94− => Order o -> o -> a -> Aggregate (NonEmptyTable a)
95−nonEmptyAggWithOrder order o (toColumns -> exprs) = fromColumns $
96− hvectorize
97− (\_ (Identity (E x)) -> A $ nonEmptyAggExprWithOrder order o x)
98− (pure exprs)