on master help sign in
I forgot to add the Exposed file. Oops.
commit3fdd47d71fffc1ffb4c7cf7f0c7b8d63b61a15de authorPaweł Nowak <pawel834@gmail.com> dateThu 30 Oct 2014, 13:27 (12 years ago) parent3ccb3a4
1 file changed+26
Data/Profunctor/Exposed.hs+26
Data/Profunctor/Exposed.hsnew file+26
@@ -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