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 | Safe |
Language | Haskell2010 |
- 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), Costrong p) => Corepresentable p where
- cotabulated :: (Corepresentable p, Corepresentable q) => Iso (Corep p d -> c) (Corep q d' -> c') (p d c) (q d' c')
- unfirstCorep :: Corepresentable p => p (a, d) (b, d) -> p a b
- unsecondCorep :: Corepresentable p => p (d, a) (d, b) -> p a b
- closedCorep :: Corepresentable p => p a b -> p (x -> a) (x -> b)
- data Prep p a where
- prepAdj :: (forall a. Prep p a -> g a) -> p :-> Star g
- unprepAdj :: (p :-> Star g) -> Prep p a -> g a
- prepUnit :: p :-> Star (Prep p)
- prepCounit :: Prep (Star f) a -> f a
- newtype Coprep p a = Coprep {
- runCoprep :: forall r. p a r -> r
- coprepAdj :: (forall a. f a -> Coprep p a) -> p :-> Costar f
- uncoprepAdj :: (p :-> Costar f) -> f a -> Coprep p a
- coprepUnit :: p :-> Costar (Coprep p)
- coprepCounit :: f a -> Coprep (Costar f) a
Representable Profunctors
class (Sieve p (Rep p), Strong p) => Representable p where #
A Profunctor
p
is Representable
if there exists a Functor
f
such that
p d c
is isomorphic to d -> f c
.
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') #
tabulate
and sieve
form two halves of an isomorphism.
This can be used with the combinators from the lens
package.
tabulated
::Representable
p =>Iso'
(d ->Rep
p c) (p d c)
firstRep :: Representable p => p a b -> p (a, c) (b, c) #
Default definition for first'
given that p is Representable
.
secondRep :: Representable p => p a b -> p (c, a) (c, b) #
Default definition for second'
given that p is Representable
.
Corepresentable Profunctors
class (Cosieve p (Corep p), Costrong p) => Corepresentable p where #
A Profunctor
p
is Corepresentable
if there exists a Functor
f
such that
p d c
is isomorphic to f d -> c
.
cotabulate :: (Corep p d -> c) -> p d c #
Laws:
cotabulate
.
cosieve
≡id
cosieve
.
cotabulate
≡id
Corepresentable (->) # | |
Functor w => Corepresentable (Cokleisli w) # | |
Corepresentable (Tagged *) # | |
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') #
cotabulate
and cosieve
form two halves of an isomorphism.
This can be used with the combinators from the lens
package.
cotabulated
::Corep
f p =>Iso'
(f d -> c) (p d c)
unfirstCorep :: Corepresentable p => p (a, d) (b, d) -> p a b #
Default definition for unfirst
given that p
is Corepresentable
.
unsecondCorep :: Corepresentable p => p (d, a) (d, b) -> p a b #
Default definition for unsecond
given that p
is Corepresentable
.
closedCorep :: Corepresentable p => p a b -> p (x -> a) (x -> b) #
Default definition for closed
given that p
is Corepresentable
Prep -| Star
Prep
-|Star
:: [Hask, Hask] -> Prof
This gives rise to a monad in Prof
, ('Star'.'Prep')
, and
a comonad in [Hask,Hask]
('Prep'.'Star')
(Monad (Rep p), Representable p) => Monad (Prep p) # | |
Profunctor p => Functor (Prep p) # | |
(Applicative (Rep p), Representable p) => Applicative (Prep p) # | |
prepCounit :: Prep (Star f) a -> f a #
Coprep -| Costar
uncoprepAdj :: (p :-> Costar f) -> f a -> Coprep p a #
coprepUnit :: p :-> Costar (Coprep p) #
coprepCounit :: f a -> Coprep (Costar f) a #