Coordinate around new definitions.

This commit is contained in:
Kei Hibino 2013-08-26 23:51:53 +09:00
parent de058f3b13
commit b04c40cacb
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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