| Copyright | (C) 2011-2015 Edward Kmett, |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | provisional |
| Portability | Type-Families |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Data.Profunctor.Rep
Description
- class (Sieve p (Rep p), Strong p) => Representable p where
- tabulated :: (Representable p, Representable q) => Iso (d -> Rep p c) (d' -> Rep q c') (p d c) (q d' c')
- firstRep :: Representable p => p a b -> p (a, c) (b, c)
- secondRep :: Representable p => p a b -> p (c, a) (c, b)
- class Cosieve p (Corep p) => Corepresentable p where
- type Corep p :: * -> *
- cotabulate :: (Corep p d -> c) -> p d c
- cotabulated :: (Corepresentable p, Corepresentable q) => Iso (Corep p d -> c) (Corep q d' -> c') (p d c) (q d' c')
Representable Profunctors
class (Sieve p (Rep p), Strong p) => Representable p where Source
A Profunctor p is Representable if there exists a Functor f such that
p d c is isomorphic to d -> f c.
Instances
| Representable (->) | |
| (Monad m, Functor m) => Representable (Kleisli m) | |
| Representable (Forget r) | |
| Functor f => Representable (Star f) | |
| (Representable p, Representable q) => Representable (Procompose p q) | The composition of two |
tabulated :: (Representable p, Representable q) => Iso (d -> Rep p c) (d' -> Rep q c') (p d c) (q d' c') Source
tabulate and sieve form two halves of an isomorphism.
This can be used with the combinators from the lens package.
tabulated::Representablep =>Iso'(d ->Repp c) (p d c)
firstRep :: Representable p => p a b -> p (a, c) (b, c) Source
Default definition for first' given that p is Representable.
secondRep :: Representable p => p a b -> p (c, a) (c, b) Source
Default definition for second' given that p is Representable.
Corepresentable Profunctors
class Cosieve p (Corep p) => Corepresentable p where Source
A Profunctor p is Corepresentable if there exists a Functor f such that
p d c is isomorphic to f d -> c.
Methods
cotabulate :: (Corep p d -> c) -> p d c Source
Instances
| Corepresentable (->) | |
| Corepresentable (Tagged *) | |
| Functor w => Corepresentable (Cokleisli w) | |
| Functor f => Corepresentable (Costar f) | |
| (Corepresentable p, Corepresentable q) => Corepresentable (Procompose p q) |
cotabulated :: (Corepresentable p, Corepresentable q) => Iso (Corep p d -> c) (Corep q d' -> c') (p d c) (q d' c') Source
cotabulate and cosieve form two halves of an isomorphism.
This can be used with the combinators from the lens package.
cotabulated::Corepf p =>Iso'(f d -> c) (p d c)