relational-query-0.8.0.0: 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.

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

Lift to Orderings.

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