opaleye-0.9.5.1: An SQL-generating DSL targeting PostgreSQL
Safe HaskellSafe-Inferred
LanguageHaskell2010

Opaleye.Internal.QueryArr

Synopsis

Documentation

newtype SelectArr a b Source #

A parametrised Select. A SelectArr a b accepts an argument of type a.

SelectArr a b is analogous to a Haskell function a -> [b].

Constructors

QueryArr 

Fields

Instances

Instances details
Arrow QueryArr Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

arr :: (b -> c) -> QueryArr b c #

first :: QueryArr b c -> QueryArr (b, d) (c, d) #

second :: QueryArr b c -> QueryArr (d, b) (d, c) #

(***) :: QueryArr b c -> QueryArr b' c' -> QueryArr (b, b') (c, c') #

(&&&) :: QueryArr b c -> QueryArr b c' -> QueryArr b (c, c') #

ArrowApply QueryArr Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

app :: QueryArr (QueryArr b c, b) c #

ArrowChoice QueryArr Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

left :: QueryArr b c -> QueryArr (Either b d) (Either c d) #

right :: QueryArr b c -> QueryArr (Either d b) (Either d c) #

(+++) :: QueryArr b c -> QueryArr b' c' -> QueryArr (Either b b') (Either c c') #

(|||) :: QueryArr b d -> QueryArr c d -> QueryArr (Either b c) d #

ProductProfunctor QueryArr Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

purePP :: b -> QueryArr a b #

(****) :: QueryArr a (b -> c) -> QueryArr a b -> QueryArr a c #

empty :: QueryArr () () #

(***!) :: QueryArr a b -> QueryArr a' b' -> QueryArr (a, a') (b, b') #

Profunctor QueryArr Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

dimap :: (a -> b) -> (c -> d) -> QueryArr b c -> QueryArr a d #

lmap :: (a -> b) -> QueryArr b c -> QueryArr a c #

rmap :: (b -> c) -> QueryArr a b -> QueryArr a c #

(#.) :: forall a b c q. Coercible c b => q b c -> QueryArr a b -> QueryArr a c #

(.#) :: forall a b c q. Coercible b a => QueryArr b c -> q a b -> QueryArr a c #

Category QueryArr Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

id :: forall (a :: k). QueryArr a a #

(.) :: forall (b :: k) (c :: k) (a :: k). QueryArr b c -> QueryArr a b -> QueryArr a c #

Applicative (QueryArr a) Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

pure :: a0 -> QueryArr a a0 #

(<*>) :: QueryArr a (a0 -> b) -> QueryArr a a0 -> QueryArr a b #

liftA2 :: (a0 -> b -> c) -> QueryArr a a0 -> QueryArr a b -> QueryArr a c #

(*>) :: QueryArr a a0 -> QueryArr a b -> QueryArr a b #

(<*) :: QueryArr a a0 -> QueryArr a b -> QueryArr a a0 #

Functor (QueryArr a) Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

fmap :: (a0 -> b) -> QueryArr a a0 -> QueryArr a b #

(<$) :: a0 -> QueryArr a b -> QueryArr a a0 #

Monad (QueryArr a) Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

(>>=) :: QueryArr a a0 -> (a0 -> QueryArr a b) -> QueryArr a b #

(>>) :: QueryArr a a0 -> QueryArr a b -> QueryArr a b #

return :: a0 -> QueryArr a a0 #

stateQueryArr :: (a -> Tag -> (b, PrimQueryArr, Tag)) -> QueryArr a b Source #

type Select = SelectArr () Source #

A SELECT, i.e. an SQL query which produces a collection of rows.

Select a is analogous to a Haskell value [a].

lateral :: (i -> Select a) -> SelectArr i a Source #

Implements LATERAL subqueries.

You might find it easier to use laterally (if you want to apply aggregate, orderBy or limit to a SelectArr) or bilaterally (if you want to apply union, intersect and except to two SelectArrs).

viaLateral :: SelectArr i a -> i -> Select a Source #

Convert an arrow argument into a function argument so that it can be applied inside do-notation rather than arrow notation.

bind :: SelectArr i a -> (a -> SelectArr i b) -> SelectArr i b Source #