File tree Expand file tree Collapse file tree 10 files changed +18
-18
lines changed
Expand file tree Collapse file tree 10 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 2222
2323- ` ask (local f x) = f (ask x) `
2424- ` extract (local _ x) = extract a `
25- - ` extend g (local f x) = extend (g <<< local f) x `
25+ - ` extend g (local f x) = extend (g <<< local f) x `
2626
2727##### Instances
2828``` purescript
@@ -33,7 +33,7 @@ instance comonadEnvEnvT :: (Comonad w) => ComonadEnv e (EnvT e w)
3333#### ` asks `
3434
3535``` purescript
36- asks :: forall e1 e2 w a . (ComonadEnv e1 w) => (e1 -> e2) -> w e1 -> e2
36+ asks :: forall e1 e2 w. (ComonadEnv e1 w) => (e1 -> e2) -> w e1 -> e2
3737```
3838
3939Get a value which depends on the environment.
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ Get a value which depends on the current position.
6060#### ` censor `
6161
6262``` purescript
63- censor :: forall w a t b . (Functor w) => (t -> t) -> TracedT t w a -> TracedT t w a
63+ censor :: forall w a t. (Functor w) => (t -> t) -> TracedT t w a -> TracedT t w a
6464```
6565
6666Apply a function to the current position.
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Run a computation in the `Reader` monad.
2222#### ` withReader `
2323
2424``` purescript
25- withReader :: forall r1 r2 a b . (r2 -> r1) -> Reader r1 a -> Reader r2 a
25+ withReader :: forall r1 r2 a. (r2 -> r1) -> Reader r1 a -> Reader r2 a
2626```
2727
2828Change the type of the context in a ` Reader ` monad action.
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ Change the type of the result in a `ReaderT` monad action.
5757#### ` withReaderT `
5858
5959``` purescript
60- withReaderT :: forall r1 r2 m a b . (r2 -> r1) -> ReaderT r1 m a -> ReaderT r2 m a
60+ withReaderT :: forall r1 r2 m a. (r2 -> r1) -> ReaderT r1 m a -> ReaderT r2 m a
6161```
6262
6363Change the type of the context in a ` ReaderT ` monad action.
Original file line number Diff line number Diff line change 3232#### ` tell `
3333
3434``` purescript
35- tell :: forall w m a . (Monoid w, Monad m, MonadWriter w m) => w -> m Unit
35+ tell :: forall w m. (Monoid w, Monad m, MonadWriter w m) => w -> m Unit
3636```
3737
3838Append a value to the accumulator.
Original file line number Diff line number Diff line change @@ -22,13 +22,13 @@ import Data.Tuple
2222-- |
2323-- | - `ask (local f x) = f (ask x)`
2424-- | - `extract (local _ x) = extract a`
25- -- | - `extend g (local f x) = extend (g <<< local f) x`
25+ -- | - `extend g (local f x) = extend (g <<< local f) x`
2626class (Comonad w ) <= ComonadEnv e w where
2727 ask :: forall a . w a -> e
2828 local :: forall a . (e -> e ) -> w a -> w a
29-
29+
3030-- | Get a value which depends on the environment.
31- asks :: forall e1 e2 w a . (ComonadEnv e1 w ) => (e1 -> e2 ) -> w e1 -> e2
31+ asks :: forall e1 e2 w . (ComonadEnv e1 w ) => (e1 -> e2 ) -> w e1 -> e2
3232asks f x = f $ ask x
3333
3434instance comonadEnvTuple :: ComonadEnv e (Tuple e ) where
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class (Comonad w) <= ComonadTraced t w where
3434-- | Extracts a value at a relative position which depends on the current value.
3535tracks :: forall w a t . (Comonad w , ComonadTraced t w ) => (a -> t ) -> w a -> a
3636tracks f w = track (f $ extract w) w
37-
37+
3838-- | Get the current position.
3939listen :: forall w a t . (Functor w ) => TracedT t w a -> TracedT t w (Tuple a t )
4040listen tr = TracedT ((\f t -> Tuple (f t) t) <$> runTracedT tr)
@@ -44,8 +44,8 @@ listens :: forall w a t b. (Functor w) => (t -> b) -> TracedT t w a -> TracedT t
4444listens f tr = TracedT ((\g t -> Tuple (g t) (f t)) <$> runTracedT tr)
4545
4646-- | Apply a function to the current position.
47- censor :: forall w a t b . (Functor w ) => (t -> t ) -> TracedT t w a -> TracedT t w a
47+ censor :: forall w a t . (Functor w ) => (t -> t ) -> TracedT t w a -> TracedT t w a
4848censor f tr = TracedT ((>>>) f <$> runTracedT tr)
4949
5050instance comonadTracedTracedT :: (Comonad w , Monoid t ) => ComonadTraced t (TracedT t w ) where
51- track t tr = extract (runTracedT tr) t
51+ track t tr = extract (runTracedT tr) t
Original file line number Diff line number Diff line change 11-- | This module defines the `Reader` monad.
22
3- module Control.Monad.Reader
3+ module Control.Monad.Reader
44 ( Reader ()
55 , runReader
66 , mapReader
@@ -24,7 +24,7 @@ runReader :: forall r a. Reader r a -> r -> a
2424runReader m = runIdentity <<< runReaderT m
2525
2626-- | Change the type of the context in a `Reader` monad action.
27- withReader :: forall r1 r2 a b . (r2 -> r1 ) -> Reader r1 a -> Reader r2 a
27+ withReader :: forall r1 r2 a . (r2 -> r1 ) -> Reader r1 a -> Reader r2 a
2828withReader = withReaderT
2929
3030-- | Change the type of the result in a `Reader` monad action.
Original file line number Diff line number Diff line change 11-- | This module defines the reader monad transformer, `ReaderT`.
22
3- module Control.Monad.Reader.Trans
3+ module Control.Monad.Reader.Trans
44 ( ReaderT (..), runReaderT , withReaderT , mapReaderT
55 , module Control.Monad.Trans
66 , module Control.Monad.Reader.Class
@@ -42,7 +42,7 @@ mapReaderT :: forall r m1 m2 a b. (m1 a -> m2 b) -> ReaderT r m1 a -> ReaderT r
4242mapReaderT f m = ReaderT $ f <<< runReaderT m
4343
4444-- | Change the type of the context in a `ReaderT` monad action.
45- withReaderT :: forall r1 r2 m a b . (r2 -> r1 ) -> ReaderT r1 m a -> ReaderT r2 m a
45+ withReaderT :: forall r1 r2 m a . (r2 -> r1 ) -> ReaderT r1 m a -> ReaderT r2 m a
4646withReaderT f m = ReaderT $ runReaderT m <<< f
4747
4848instance functorReaderT :: (Functor m ) => Functor (ReaderT r m ) where
@@ -90,7 +90,7 @@ instance monadReaderReaderT :: (Monad m) => MonadReader r (ReaderT r m) where
9090
9191instance monadStateReaderT :: (MonadState s m ) => MonadState s (ReaderT r m ) where
9292 state f = lift (state f)
93-
93+
9494instance monadWriterReaderT :: (Monad m , MonadWriter w m ) => MonadWriter w (ReaderT r m ) where
9595 writer wd = lift (writer wd)
9696 listen = mapReaderT listen
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class (Monad m) <= MonadWriter w m where
3030 pass :: forall a . m (Tuple a (w -> w )) -> m a
3131
3232-- | Append a value to the accumulator.
33- tell :: forall w m a . (Monoid w , Monad m , MonadWriter w m ) => w -> m Unit
33+ tell :: forall w m . (Monoid w , Monad m , MonadWriter w m ) => w -> m Unit
3434tell w = writer $ Tuple unit w
3535
3636-- | Read a value which depends on the modifications made to the accumulator during an action.
You can’t perform that action at this time.
0 commit comments