opaleye-0.7.3.0: An SQL-generating DSL targeting PostgreSQL
Safe HaskellNone
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 ((a, Tag) -> (b, Lateral -> PrimQuery -> PrimQuery, Tag)) 

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') #

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 #

ArrowApply QueryArr Source # 
Instance details

Defined in Opaleye.Internal.QueryArr

Methods

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

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 #

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') #

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 #

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 #

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 #

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 #

productQueryArr :: ((a, Tag) -> (b, PrimQuery, Tag)) -> QueryArr a b Source #

simpleQueryArr :: ((a, Tag) -> (b, PrimQuery, Tag)) -> QueryArr a b Source #

Deprecated: Use productQueryArr instead. Its name indicates better what it actually does

runQueryArr :: QueryArr a b -> (a, Tag) -> (b, Lateral -> PrimQuery -> PrimQuery, Tag) Source #

first3 :: (a1 -> b) -> (a1, a2, a3) -> (b, a2, a3) 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 #