opaleye-0.7.3.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).

Users should almost never need to create or manipulate Unpackspecs. Typically they will be created automatically by the Default instance. If you really need to you can create Unpackspecs by hand using unpackspecColumn and the Profunctor, ProductProfunctor and SumProfunctor operations.

Instances

Instances details
Profunctor Unpackspec Source # 
Instance details

Defined in Opaleye.Internal.Unpackspec

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 #

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

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

ProductProfunctor Unpackspec Source # 
Instance details

Defined in Opaleye.Internal.Unpackspec

Methods

purePP :: b -> Unpackspec a b #

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

empty :: Unpackspec () () #

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

SumProfunctor Unpackspec Source # 
Instance details

Defined in Opaleye.Internal.Unpackspec

Methods

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

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

Defined in Opaleye.Internal.Unpackspec

Methods

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

Default Unpackspec a b => Default Unpackspec (MaybeFields a) (MaybeFields b) Source # 
Instance details

Defined in Opaleye.Internal.MaybeFields

Functor (Unpackspec a) Source # 
Instance details

Defined in Opaleye.Internal.Unpackspec

Methods

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

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

Applicative (Unpackspec a) Source # 
Instance details

Defined in Opaleye.Internal.Unpackspec

Methods

pure :: a0 -> Unpackspec a a0 #

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

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

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

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

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

Deprecated: Use unpackspecField instead. Will be removed in version 0.8.

unpackspecField :: 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