diff --git a/relational-join/src/Database/Relational/Query/Monad/Trans/AggregatingState.hs b/relational-join/src/Database/Relational/Query/Monad/Trans/AggregatingState.hs index 9a83290f..cc3c59db 100644 --- a/relational-join/src/Database/Relational/Query/Monad/Trans/AggregatingState.hs +++ b/relational-join/src/Database/Relational/Query/Monad/Trans/AggregatingState.hs @@ -19,7 +19,7 @@ module Database.Relational.Query.Monad.Trans.AggregatingState ( addGroupBy, addRestriction, - aggregatedRestriction, aggregateTerms, + aggregateRestriction, aggregateTerms, composeGroupBys ) where @@ -61,9 +61,11 @@ addRestriction e1 ctx = where uf Nothing = fromJust e1 uf (Just e0) = e0 `exprAnd` fromJust e1 -aggregatedRestriction :: AggregatingContext -> AggregatedQueryRestriction -aggregatedRestriction = restriction +-- | Finalize context to extract accumulated aggregate restriction state. +aggregateRestriction :: AggregatingContext -> AggregatedQueryRestriction +aggregateRestriction = restriction +-- | Finalize context to extract accumulated aggregate terms state. aggregateTerms :: AggregatingContext -> AggregateTerms aggregateTerms = DList.toList . groupByTerms diff --git a/relational-join/src/Database/Relational/Query/Monad/Trans/OrderingState.hs b/relational-join/src/Database/Relational/Query/Monad/Trans/OrderingState.hs index c31f6d5f..d8cd60ae 100644 --- a/relational-join/src/Database/Relational/Query/Monad/Trans/OrderingState.hs +++ b/relational-join/src/Database/Relational/Query/Monad/Trans/OrderingState.hs @@ -59,6 +59,7 @@ restoreLowOrderBys :: OrderBys -> OrderingContext -> OrderingContext restoreLowOrderBys ros ctx = ctx { orderBys = orderBys ctx <> ros } -} +-- | Finalize context to extract accumulated ordering state. orderingTerms :: OrderingContext -> OrderingTerms orderingTerms = DList.toList . orderBys diff --git a/relational-join/src/Database/Relational/Query/Monad/Trans/RestrictingState.hs b/relational-join/src/Database/Relational/Query/Monad/Trans/RestrictingState.hs index df8a6389..6afffa33 100644 --- a/relational-join/src/Database/Relational/Query/Monad/Trans/RestrictingState.hs +++ b/relational-join/src/Database/Relational/Query/Monad/Trans/RestrictingState.hs @@ -32,6 +32,7 @@ import qualified Language.SQL.Keyword as SQL -- | Context type for Restrict. newtype RestrictContext = RestrictContext QueryRestriction +-- | Finalize context to extract accumulated restriction state. restriction :: RestrictContext -> QueryRestriction restriction (RestrictContext r) = r