File tree Expand file tree Collapse file tree 3 files changed +53
-3
lines changed
Expand file tree Collapse file tree 3 files changed +53
-3
lines changed Original file line number Diff line number Diff line change 11# Module Documentation
22
3+ ## Module Control.Comonad.Env.Trans
4+
5+ ### Types
6+
7+ newtype EnvT e w a where
8+ EnvT :: Tuple e (w a) -> EnvT e w a
9+
10+
11+ ### Type Class Instances
12+
13+ instance extendEnvT :: (Extend w) => Extend (EnvT e w)
14+
15+ instance functorEnvT :: (Functor w) => Functor (EnvT e w)
16+
17+
18+ ### Values
19+
20+ runEnvT :: forall e w a. EnvT e w a -> Tuple e (w a)
21+
22+
23+ ## Module Control.Comonad.Trans
24+
25+ ### Type Classes
26+
27+ class ComonadTrans f where
28+ lower :: forall w a. (Comonad w) => f w a -> w a
29+
30+
331## Module Control.Monad.Cont.Class
432
533### Type Classes
3563
3664 instance applicativeContT :: (Functor m, Monad m) => Applicative (ContT r m)
3765
38- instance appluContT :: (Functor m, Monad m) => Apply (ContT r m)
66+ instance applyContT :: (Functor m, Monad m) => Apply (ContT r m)
3967
4068 instance bindContT :: (Monad m) => Bind (ContT r m)
4169
109137
110138 instance alternativeErrorT :: (Monad m, Error e) => Alternative (ErrorT e m)
111139
112- instance applicativeErrorT :: (Functor m, Monad m) => Applicative (ErrorT e m)
140+ instance applicativeErrorT :: (Applicative m) => Applicative (ErrorT e m)
113141
114- instance applyErrorT :: (Functor m, Monad m) => Apply (ErrorT e m)
142+ instance applyErrorT :: (Apply m) => Apply (ErrorT e m)
115143
116144 instance bindErrorT :: (Monad m, Error e) => Bind (ErrorT e m)
117145
Original file line number Diff line number Diff line change 1+ module Control.Comonad.Env.Trans where
2+
3+ import Control.Comonad
4+ import Control.Extend
5+ import Data.Tuple
6+
7+ newtype EnvT e w a = EnvT (Tuple e (w a ))
8+
9+ runEnvT :: forall e w a . EnvT e w a -> Tuple e (w a )
10+ runEnvT (EnvT x) = x
11+
12+ instance functorEnvT :: (Functor w ) => Functor (EnvT e w ) where
13+ (<$>) f (EnvT (Tuple e x)) = EnvT $ Tuple e (f <$> x)
14+
15+ instance extendEnvT :: (Extend w ) => Extend (EnvT e w ) where
16+ (<<=) f (EnvT (Tuple e x)) = EnvT $ Tuple e (f <$> ((Tuple e >>> EnvT ) <<= x))
Original file line number Diff line number Diff line change 1+ module Control.Comonad.Trans where
2+
3+ import Control.Comonad
4+
5+ class ComonadTrans f where
6+ lower :: forall w a . (Comonad w ) => f w a -> w a
You can’t perform that action at this time.
0 commit comments