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

Copyright2014-2017 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Monad.Trans.Restricting

Contents

Description

This module defines monad transformer which lift to basic MonadQuery.

Synopsis

Transformer into restricted context

data Restrictings c m a Source #

Type to accumulate query restrictions. Type c is context tag of restriction building like Flat (where) or Aggregated (having).

Instances

MonadQualify q m => MonadQualify q (Restrictings c m) Source #

Restricted MonadQualify instance.

Methods

liftQualify :: q a -> Restrictings c m a Source #

(Monad q, Functor q) => MonadRestrict c (Restrictings c q) Source #

MonadRestrict instance.

Methods

restrict :: Predicate c -> Restrictings c q () Source #

MonadTrans (Restrictings c) Source # 

Methods

lift :: Monad m => m a -> Restrictings c m a #

Monad m => Monad (Restrictings c m) Source # 

Methods

(>>=) :: Restrictings c m a -> (a -> Restrictings c m b) -> Restrictings c m b #

(>>) :: Restrictings c m a -> Restrictings c m b -> Restrictings c m b #

return :: a -> Restrictings c m a #

fail :: String -> Restrictings c m a #

Functor m => Functor (Restrictings c m) Source # 

Methods

fmap :: (a -> b) -> Restrictings c m a -> Restrictings c m b #

(<$) :: a -> Restrictings c m b -> Restrictings c m a #

Applicative m => Applicative (Restrictings c m) Source # 

Methods

pure :: a -> Restrictings c m a #

(<*>) :: Restrictings c m (a -> b) -> Restrictings c m a -> Restrictings c m b #

(*>) :: Restrictings c m a -> Restrictings c m b -> Restrictings c m b #

(<*) :: Restrictings c m a -> Restrictings c m b -> Restrictings c m a #

MonadAggregate m => MonadAggregate (Restrictings c m) Source #

Resticted MonadAggregate instance.

MonadQuery q => MonadQuery (Restrictings c q) Source #

Restricted MonadQuery instance.

restrictings :: Monad m => m a -> Restrictings c m a Source #

Lift to Restrictings

Result

extractRestrict :: (Monad m, Functor m) => Restrictings c m a -> m (a, [Predicate c]) Source #

Run Restrictings to get QueryRestriction