composite-opaleye-0.7.4.0: Opaleye SQL for Vinyl records

Safe HaskellNone
LanguageHaskell2010

Composite.Opaleye.ProductProfunctors

Contents

Synopsis

Documentation

class ProductProfunctor p => PRec p rs where Source #

Type class implementing traversal of a record, yanking individual product profunctors Record [p a b] (though with distinct a and b at each position) up to p (Record as) (Record bs).

This is similar to the pN functions on tuples provided by the product-profunctors library.

Associated Types

type PRecContra p rs :: [*] Source #

Record fields rs with the profunctor removed yielding the contravariant parameter. E.g. PRecContra p '[p a b] ~ '[a]

type PRecCo p rs :: [*] Source #

Record fields rs with the profunctor removed yielding the covariant parameter. E.g. PRecContra p '[p a b] ~ '[a]

Methods

pRec :: Rec Identity rs -> p (Rec Identity (PRecContra p rs)) (Rec Identity (PRecCo p rs)) Source #

Traverse the record, transposing the profunctors p within to the outside like traverse does for Applicative effects.

Roughly equivalent to Record '[p a b, p c d, …] -> p (Record '[a, c, …]) (Record '[b, d, …])

Instances
ProductProfunctor p => PRec p ([] :: [Type]) Source # 
Instance details

Defined in Composite.Opaleye.ProductProfunctors

Associated Types

type PRecContra p [] :: [Type] Source #

type PRecCo p [] :: [Type] Source #

Methods

pRec :: Rec Identity [] -> p (Rec Identity (PRecContra p [])) (Rec Identity (PRecCo p [])) Source #

(ProductProfunctor p, PRec p rs) => PRec p ((s :-> p a b) ': rs) Source # 
Instance details

Defined in Composite.Opaleye.ProductProfunctors

Associated Types

type PRecContra p ((s :-> p a b) ': rs) :: [Type] Source #

type PRecCo p ((s :-> p a b) ': rs) :: [Type] Source #

Methods

pRec :: Rec Identity ((s :-> p a b) ': rs) -> p (Rec Identity (PRecContra p ((s :-> p a b) ': rs))) (Rec Identity (PRecCo p ((s :-> p a b) ': rs))) Source #

Orphan instances

(ProductProfunctor p, Default p a b, Default p (Rec Identity rsContra) (Rec Identity rsCo)) => Default p (Rec Identity ((s :-> a) ': rsContra)) (Rec Identity ((s :-> b) ': rsCo)) Source # 
Instance details

Methods

def :: p (Rec Identity ((s :-> a) ': rsContra)) (Rec Identity ((s :-> b) ': rsCo)) #

ProductProfunctor p => Default p (Rec Identity ([] :: [Type])) (Rec Identity ([] :: [Type])) Source # 
Instance details

Methods

def :: p (Rec Identity []) (Rec Identity []) #