| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Composite.Opaleye.ProductProfunctors
Contents
- class ProductProfunctor p => PRec p rs where
- type PRecContra p rs :: [*]
- type PRecCo p rs :: [*]
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
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, …])