@@ -0,0 +1,26 @@
1+{-# LANGUAGE FunctionalDependencies #-}
2+{-# LANGUAGE MultiParamTypeClasses #-}
3+{- |
4+Module : Data.Profunctor.Exposed
5+Description : Exposes Kleisli category structure beneath a profunctor.
6+Copyright : (c) Paweł Nowak
7+License : MIT
8+
9+Maintainer : Paweł Nowak <pawel834@gmail.com>
10+Stability : experimental
11+-}
12+module Data.Profunctor.Exposed where
13+
14+import Data.Profunctor
15+
16+-- | Exposes structure of a Kleisli category beneath a profunctor.
17+--
18+-- Should obey laws:
19+--
20+-- > merge . rmap return = id
21+-- > lmap return . expose = id
22+-- > rmap (>>= f) = merge . rmap (fmap f)
23+-- > lmap (fmap f) . expose = expose . lmap f
24+class (Monad m, Profunctor p) => Exposed m p | p -> m where
25+ expose :: p a b -> p (m a) b
26+ merge :: p a (m b) -> p a b