Portability | MPTCs |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | None |
- class (Functor f, Profunctor p) => Rep f p where
- tabulated :: (Profunctor r, Functor h, Rep f p, Rep g q) => r (p d c) (h (q d' c')) -> r (d -> f c) (h (d' -> g c'))
- class (Functor f, Profunctor p) => Corep f p where
- cotabulate :: (f d -> c) -> p d c
- corep :: p d c -> f d -> c
- cotabulated :: (Profunctor r, Functor h, Corep f p, Corep g q) => r (p d c) (h (q d' c')) -> r (f d -> c) (h (g d' -> c'))
Representable Profunctors
class (Functor f, Profunctor p) => Rep f p whereSource
A Profunctor
p
is representable if there exists a Functor
f
such that
p d c
is isomorphic to d -> f c
.
Rep Identity (->) | |
(Profunctor (UpStar f), Functor f) => Rep f (UpStar f) | |
(Profunctor (Kleisli m), Monad m, Functor m) => Rep m (Kleisli m) | |
(Functor (Compose f g), Profunctor (Procompose p q), Rep f p, Rep g q) => Rep (Compose f g) (Procompose p q) | The composition of two representable profunctors is representable by the composition of their representations. |
tabulated :: (Profunctor r, Functor h, Rep f p, Rep g q) => r (p d c) (h (q d' c')) -> r (d -> f c) (h (d' -> g c'))Source
Corepresentable Profunctors
class (Functor f, Profunctor p) => Corep f p whereSource
A Profunctor
p
is representable if there exists a Functor
f
such that
p d c
is isomorphic to d -> f c
.
cotabulate :: (f d -> c) -> p d cSource
Corep Identity (->) | |
(Profunctor (DownStar f), Functor f) => Corep f (DownStar f) | |
(Profunctor (Cokleisli w), Functor w) => Corep w (Cokleisli w) | |
Corep (Proxy *) (Tagged *) | |
(Functor (Compose g f), Profunctor (Procompose p q), Corep f p, Corep g q) => Corep (Compose g f) (Procompose p q) |
cotabulated :: (Profunctor r, Functor h, Corep f p, Corep g q) => r (p d c) (h (q d' c')) -> r (f d -> c) (h (g d' -> c'))Source
cotabulate
and corep
form two halves of an isomorphism.
This can be used with the combinators from the lens
package.
tabulated
::Corep
f p =>Iso'
(f d -> c) (p d c)