@@ -402,23 +402,23 @@ renderBy (By (table, column)) = renderAlias table <> "." <> renderAlias column
402402
403403data GroupByClause tables grouping where
404404 NoGroups :: GroupByClause tables 'Ungrouped
405− Distinct
406− :: SListI distincts
407− => NP (By tables) distincts
408− -> GroupByClause tables ('Grouped distincts)
405+ Group
406+ :: SListI bys
407+ => NP (By tables) bys
408+ -> GroupByClause tables ('Grouped bys)
409409
410410renderGroupByClause :: GroupByClause tables grouping -> ByteString
411411renderGroupByClause = \case
412412 NoGroups -> ""
413− Distinct Nil -> ""
414− Distinct distincts -> " GROUP BY " <> ByteString.intercalate ", "
415− (hcollapse (hmap (K . renderBy) distincts))
413+ Group Nil -> ""
414+ Group bys -> " GROUP BY " <> ByteString.intercalate ", "
415+ (hcollapse (hmap (K . renderBy) bys))
416416
417417data HavingClause params tables grouping where
418418 NoHaving :: HavingClause params tables 'Ungrouped
419419 Having
420− :: [Condition params tables ('Grouped distincts)]
421− -> HavingClause params tables ('Grouped distincts)
420+ :: [Condition params tables ('Grouped bys)]
421+ -> HavingClause params tables ('Grouped bys)
422422
423423renderHavingClause :: HavingClause params tables grouping -> ByteString
424424renderHavingClause = \case
@@ -428,12 +428,12 @@ renderHavingClause = \case
428428 (renderExpression <$> conditions)
429429
430430class (KnownSymbol table, KnownSymbol column)
431− => GroupedBy table column distincts where
431+ => GroupedBy table column bys where
432432 getGroup
433433 :: (HasTable table tables columns, HasColumn column columns ty)
434434 => Alias table
435435 -> Alias column
436− -> Expression params tables ('Grouped distincts) ty
436+ -> Expression params tables ('Grouped bys) ty
437437 getGroup table column = UnsafeExpression $
438438 renderAlias table <> "." <> renderAlias column
439439instance {-# OVERLAPPING #-} (KnownSymbol table, KnownSymbol column)
@@ -441,36 +441,36 @@ instance {-# OVERLAPPING #-} (KnownSymbol table, KnownSymbol column)
441441instance {-# OVERLAPPABLE #-}
442442 ( KnownSymbol table
443443 , KnownSymbol column
444− , GroupedBy table column distincts
445− ) => GroupedBy table column (tabcol ': distincts)
444+ , GroupedBy table column bys
445+ ) => GroupedBy table column (tabcol ': bys)
446446
447447instance
448448 ( tables ~ '[table ::: columns]
449449 , HasColumn column columns ty
450− , GroupedBy table column distincts
450+ , GroupedBy table column bys
451451 ) => IsLabel column
452− (Expression params tables ('Grouped distincts) ty) where
452+ (Expression params tables ('Grouped bys) ty) where
453453 fromLabel p = getGroup (Alias (proxy# :: Proxy# table)) (Alias p)
454454
455455instance
456456 ( HasTable table tables columns
457457 , HasColumn column columns ty
458− , GroupedBy table column distincts
458+ , GroupedBy table column bys
459459 ) => TableColumn table column
460− (Expression params tables ('Grouped distincts) ty) where
460+ (Expression params tables ('Grouped bys) ty) where
461461 (&.) = getGroup
462462
463463unsafeAggregate
464464 :: ByteString
465465 -> Expression params tables 'Ungrouped xty
466− -> Expression params tables ('Grouped distincts) yty
466+ -> Expression params tables ('Grouped bys) yty
467467unsafeAggregate fun x = UnsafeExpression $ mconcat
468468 [fun, "(", renderExpression x, ")"]
469469
470470sum_
471471 :: PGNum ty
472472 => Expression params tables 'Ungrouped ('Required (nullity ty))
473− -> Expression params tables ('Grouped distincts) ('Required (nullity ty))
473+ -> Expression params tables ('Grouped bys) ('Required (nullity ty))
474474sum_ = unsafeAggregate "sum"
475475
476476{-----------------------------------------
@@ -624,14 +624,14 @@ where_
624624where_ wh tables = tables {whereClause = wh : whereClause tables}
625625
626626group
627− :: SListI distincts
628− => NP (By tables) distincts
627+ :: SListI bys
628+ => NP (By tables) bys
629629 -> TableExpression params schema tables 'Ungrouped
630− -> TableExpression params schema tables ('Grouped distincts)
631−group distincts tables = TableExpression
630+ -> TableExpression params schema tables ('Grouped bys)
631+group bys tables = TableExpression
632632 { fromClause = fromClause tables
633633 , whereClause = whereClause tables
634− , groupByClause = Distinct distincts
634+ , groupByClause = Group bys
635635 , havingClause = Having []
636636 , orderByClause = []
637637 , limitClause = limitClause tables
@@ -639,9 +639,9 @@ group distincts tables = TableExpression
639639 }
640640
641641having
642− :: Condition params tables ('Grouped distincts)
643− -> TableExpression params schema tables ('Grouped distincts)
644− -> TableExpression params schema tables ('Grouped distincts)
642+ :: Condition params tables ('Grouped bys)
643+ -> TableExpression params schema tables ('Grouped bys)
644+ -> TableExpression params schema tables ('Grouped bys)
645645having hv tables = tables
646646 { havingClause = case havingClause tables of Having hvs -> Having (hv:hvs) }
647647