@@ -387,28 +387,39 @@ q1 `exceptAll` q2 = UnsafeQuery $
387387SELECT queries
388388-----------------------------------------}
389389
390+{- | The simplest kinds of `Selection` are `Star` and `DotStar` which
391+emits all columns that a `TableExpression` produces. A select `List`
392+is a list of `Expression`s. A `Selection` could be a list of
393+`WindowFunction`s `Over` `WindowDefinition`. `Additional` `Selection`s can
394+be selected with `Also`.
395+-}
390396data Selection outer commons grp schemas params from row where
391− List
392− :: SListI row
393− => NP (Aliased (Expression outer commons grp schemas params from)) row
394− -> Selection outer commons grp schemas params from row
395397 Star
396398 :: HasUnique tab from row
397399 => Selection outer commons 'Ungrouped schemas params from row
400+ -- ^ `HasUnique` table in the `FromClause`
398401 DotStar
399402 :: Has tab from row
400403 => Alias tab
404+ -- ^ `Has` table with `Alias`
401405 -> Selection outer commons 'Ungrouped schemas params from row
402− Also
403− :: Selection outer commons grp schemas params from right
404− -> Selection outer commons grp schemas params from left
405− -> Selection outer commons grp schemas params from (Join left right)
406+ List
407+ :: SListI row
408+ => NP (Aliased (Expression outer commons grp schemas params from)) row
409+ -- ^ `NP` list of `Aliased` `Expression`s
410+ -> Selection outer commons grp schemas params from row
406411 Over
407412 :: SListI row
408413 => NP (Aliased (WindowFunction outer commons grp schemas params from)) row
414+ -- ^ `NP` list of `Aliased` `WindowFunction`s
409415 -> WindowDefinition outer commons grp schemas params from
410416 -> Selection outer commons grp schemas params from row
411−instance Additionally (Selection outer commons grp schemas params from) where
417+ Also
418+ :: Selection outer commons grp schemas params from right
419+ -- ^ `Additional` `Selection`
420+ -> Selection outer commons grp schemas params from left
421+ -> Selection outer commons grp schemas params from (Join left right)
422+instance Additional (Selection outer commons grp schemas params from) where
412423 also = Also
413424instance (KnownSymbol col, row ~ '[col ::: ty])
414425 => Aliasable col
@@ -741,7 +752,7 @@ common
741752common (cte `As` alias) = UnsafeFromClause $
742753 renderSQL cte <+> "AS" <+> renderSQL alias
743754
744−instance Additionally (FromClause outer commons schemas params) where
755+instance Additional (FromClause outer commons schemas params) where
745756 also right left = UnsafeFromClause $
746757 renderSQL left <> ", " <> renderSQL right
747758