composite-opaleye-0.4.1.0: Opaleye SQL for Frames 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.

Minimal complete definition

pRec

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 ([] *) Source # 

Associated Types

type PRecContra (p :: * -> * -> *) ([] * :: [*]) :: [*] Source #

type PRecCo (p :: * -> * -> *) ([] * :: [*]) :: [*] 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 # 

Associated Types

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

type PRecCo (p :: * -> * -> *) ((:) * ((:->) s (p a b)) rs :: [*]) :: [*] 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 # 

Methods

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

ProductProfunctor p => Default p (Rec * Identity ([] *)) (Rec * Identity ([] *)) Source # 

Methods

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