opaleye-0.5.2.0: An SQL-generating DSL targeting PostgreSQL

Safe HaskellNone
LanguageHaskell2010

Opaleye.Internal.Unpackspec

Synopsis

Documentation

newtype Unpackspec columns columns' Source #

Constructors

Unpackspec (PackMap PrimExpr PrimExpr columns columns')

An Unpackspec columns columns' allows you to extract and modify a sequence of PrimExprs inside a value of type columns.

For example, the Default instance of type Unpackspec (Column a, Column b) (Column a, Column b) allows you to manipulate or extract the two PrimExprs inside a (Column a, Column b). The Default instance of type Foo (Column a) (Column b) (Column c) will allow you to manipulate or extract the three PrimExprs contained therein (for a user-defined product type Foo, assuming the makeAdaptorAndInstance splice from Data.Profunctor.Product.TH has been run).

You can create Unpackspecs by hand using unpackspecColumn and the Profunctor, ProductProfunctor and SumProfunctor operations. However, in practice users should almost never need to create or manipulate them. Typically they will be created automatically by the Default instance.

Instances

SumProfunctor Unpackspec Source # 

Methods

(+++!) :: Unpackspec a b -> Unpackspec a' b' -> Unpackspec (Either a a') (Either b b') #

ProductProfunctor Unpackspec Source # 

Methods

empty :: Unpackspec () () #

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

Profunctor Unpackspec Source # 

Methods

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

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

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

(#.) :: Coercible * c b => (b -> c) -> Unpackspec a b -> Unpackspec a c #

(.#) :: Coercible * b a => Unpackspec b c -> (a -> b) -> Unpackspec a c #

Default Unpackspec (Column a) (Column a) Source # 

Methods

def :: Unpackspec (Column a) (Column a) #

Functor (Unpackspec a) Source # 

Methods

fmap :: (a -> b) -> Unpackspec a a -> Unpackspec a b #

(<$) :: a -> Unpackspec a b -> Unpackspec a a #

Applicative (Unpackspec a) Source # 

Methods

pure :: a -> Unpackspec a a #

(<*>) :: Unpackspec a (a -> b) -> Unpackspec a a -> Unpackspec a b #

(*>) :: Unpackspec a a -> Unpackspec a b -> Unpackspec a b #

(<*) :: Unpackspec a a -> Unpackspec a b -> Unpackspec a a #

unpackspecColumn :: Unpackspec (Column a) (Column a) Source #

Target the single PrimExpr inside a Column

runUnpackspec :: Applicative f => Unpackspec columns b -> (PrimExpr -> f PrimExpr) -> columns -> f b Source #

Modify all the targeted PrimExprs

collectPEs :: Unpackspec s t -> s -> [PrimExpr] Source #

Extract all the targeted PrimExprs