relational-query-0.0.1.2: Typeful, Modular, Relational, algebraic query engine

Copyright2013 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Query.Monad.Trans.Ordering

Contents

Description

This module defines monad transformer which lift from query into query with ordering.

Synopsis

Transformer into query with ordering

data Orderings c m a Source

Type to accumulate ordering context. Type c is ordering term projection context type.

Instances

MonadQualify ConfigureQuery QueryAggregate

Instance to lift from qualified table forms into QueryAggregate.

MonadQualify ConfigureQuery (Orderings Flat QueryCore)

Instance to lift from qualified table forms into QuerySimple.

MonadRestrict rc m => MonadRestrict rc (Orderings c m)

MonadRestrict with ordering.

MonadTrans (Orderings c) 
Monad m => Monad (Orderings c m) 
Functor m => Functor (Orderings c m) 
Applicative m => Applicative (Orderings c m) 
MonadPartition m => MonadPartition (Orderings c m)

MonadPartition with ordering.

MonadAggregate m => MonadAggregate (Orderings c m)

MonadAggregate with ordering.

MonadQuery m => MonadQuery (Orderings c m)

MonadQuery with ordering.

orderings :: Monad m => m a -> Orderings c m a Source

Lift to Orderings.

type OrderedQuery c m r = Orderings c m (Projection c r) Source

OrderedQuery type synonym. Projection must be the same as Orderings type parameter p

type OrderingTerms = [OrderingTerm] Source

Type for order-by terms

API of query with ordering

orderBy Source

Arguments

:: (Monad m, ProjectableOrdering (Projection c)) 
=> Projection c t

Ordering terms to add

-> Order

Order direction

-> Orderings c m ()

Result context with ordering

Add ordering terms.

asc Source

Arguments

:: (Monad m, ProjectableOrdering (Projection c)) 
=> Projection c t

Ordering terms to add

-> Orderings c m ()

Result context with ordering

Add ascendant ordering term.

desc Source

Arguments

:: (Monad m, ProjectableOrdering (Projection c)) 
=> Projection c t

Ordering terms to add

-> Orderings c m ()

Result context with ordering

Add descendant ordering term.

Result