From a46b635acbc296d51a9898076f4b9c438875b601 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Wed, 16 Sep 2015 16:06:37 +0100 Subject: [PATCH] Remove unused type variables --- docs/Control/Comonad/Env/Class.md | 4 ++-- docs/Control/Comonad/Traced/Class.md | 2 +- docs/Control/Monad/Reader.md | 2 +- docs/Control/Monad/Reader/Trans.md | 2 +- docs/Control/Monad/Writer/Class.md | 2 +- src/Control/Comonad/Env/Class.purs | 6 +++--- src/Control/Comonad/Traced/Class.purs | 6 +++--- src/Control/Monad/Reader.purs | 4 ++-- src/Control/Monad/Reader/Trans.purs | 6 +++--- src/Control/Monad/Writer/Class.purs | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/Control/Comonad/Env/Class.md b/docs/Control/Comonad/Env/Class.md index 533cd53a..b5e19708 100644 --- a/docs/Control/Comonad/Env/Class.md +++ b/docs/Control/Comonad/Env/Class.md @@ -22,7 +22,7 @@ Laws: - `ask (local f x) = f (ask x)` - `extract (local _ x) = extract a` -- `extend g (local f x) = extend (g <<< local f) x` +- `extend g (local f x) = extend (g <<< local f) x` ##### Instances ``` purescript @@ -33,7 +33,7 @@ instance comonadEnvEnvT :: (Comonad w) => ComonadEnv e (EnvT e w) #### `asks` ``` purescript -asks :: forall e1 e2 w a. (ComonadEnv e1 w) => (e1 -> e2) -> w e1 -> e2 +asks :: forall e1 e2 w. (ComonadEnv e1 w) => (e1 -> e2) -> w e1 -> e2 ``` Get a value which depends on the environment. diff --git a/docs/Control/Comonad/Traced/Class.md b/docs/Control/Comonad/Traced/Class.md index d2283440..a4820512 100644 --- a/docs/Control/Comonad/Traced/Class.md +++ b/docs/Control/Comonad/Traced/Class.md @@ -60,7 +60,7 @@ Get a value which depends on the current position. #### `censor` ``` purescript -censor :: forall w a t b. (Functor w) => (t -> t) -> TracedT t w a -> TracedT t w a +censor :: forall w a t. (Functor w) => (t -> t) -> TracedT t w a -> TracedT t w a ``` Apply a function to the current position. diff --git a/docs/Control/Monad/Reader.md b/docs/Control/Monad/Reader.md index 3d330ac1..1a809edf 100644 --- a/docs/Control/Monad/Reader.md +++ b/docs/Control/Monad/Reader.md @@ -22,7 +22,7 @@ Run a computation in the `Reader` monad. #### `withReader` ``` purescript -withReader :: forall r1 r2 a b. (r2 -> r1) -> Reader r1 a -> Reader r2 a +withReader :: forall r1 r2 a. (r2 -> r1) -> Reader r1 a -> Reader r2 a ``` Change the type of the context in a `Reader` monad action. diff --git a/docs/Control/Monad/Reader/Trans.md b/docs/Control/Monad/Reader/Trans.md index 4ec29ce3..d9256e72 100644 --- a/docs/Control/Monad/Reader/Trans.md +++ b/docs/Control/Monad/Reader/Trans.md @@ -57,7 +57,7 @@ Change the type of the result in a `ReaderT` monad action. #### `withReaderT` ``` purescript -withReaderT :: forall r1 r2 m a b. (r2 -> r1) -> ReaderT r1 m a -> ReaderT r2 m a +withReaderT :: forall r1 r2 m a. (r2 -> r1) -> ReaderT r1 m a -> ReaderT r2 m a ``` Change the type of the context in a `ReaderT` monad action. diff --git a/docs/Control/Monad/Writer/Class.md b/docs/Control/Monad/Writer/Class.md index f4462e29..42a1b4a3 100644 --- a/docs/Control/Monad/Writer/Class.md +++ b/docs/Control/Monad/Writer/Class.md @@ -32,7 +32,7 @@ Laws: #### `tell` ``` purescript -tell :: forall w m a. (Monoid w, Monad m, MonadWriter w m) => w -> m Unit +tell :: forall w m. (Monoid w, Monad m, MonadWriter w m) => w -> m Unit ``` Append a value to the accumulator. diff --git a/src/Control/Comonad/Env/Class.purs b/src/Control/Comonad/Env/Class.purs index 95c6d0f8..381a23ba 100644 --- a/src/Control/Comonad/Env/Class.purs +++ b/src/Control/Comonad/Env/Class.purs @@ -22,13 +22,13 @@ import Data.Tuple -- | -- | - `ask (local f x) = f (ask x)` -- | - `extract (local _ x) = extract a` --- | - `extend g (local f x) = extend (g <<< local f) x` +-- | - `extend g (local f x) = extend (g <<< local f) x` class (Comonad w) <= ComonadEnv e w where ask :: forall a. w a -> e local :: forall a. (e -> e) -> w a -> w a - + -- | Get a value which depends on the environment. -asks :: forall e1 e2 w a. (ComonadEnv e1 w) => (e1 -> e2) -> w e1 -> e2 +asks :: forall e1 e2 w. (ComonadEnv e1 w) => (e1 -> e2) -> w e1 -> e2 asks f x = f $ ask x instance comonadEnvTuple :: ComonadEnv e (Tuple e) where diff --git a/src/Control/Comonad/Traced/Class.purs b/src/Control/Comonad/Traced/Class.purs index d8287171..40ae3a89 100644 --- a/src/Control/Comonad/Traced/Class.purs +++ b/src/Control/Comonad/Traced/Class.purs @@ -34,7 +34,7 @@ class (Comonad w) <= ComonadTraced t w where -- | Extracts a value at a relative position which depends on the current value. tracks :: forall w a t. (Comonad w, ComonadTraced t w) => (a -> t) -> w a -> a tracks f w = track (f $ extract w) w - + -- | Get the current position. listen :: forall w a t. (Functor w) => TracedT t w a -> TracedT t w (Tuple a t) listen 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 listens f tr = TracedT ((\g t -> Tuple (g t) (f t)) <$> runTracedT tr) -- | Apply a function to the current position. -censor :: forall w a t b. (Functor w) => (t -> t) -> TracedT t w a -> TracedT t w a +censor :: forall w a t. (Functor w) => (t -> t) -> TracedT t w a -> TracedT t w a censor f tr = TracedT ((>>>) f <$> runTracedT tr) instance comonadTracedTracedT :: (Comonad w, Monoid t) => ComonadTraced t (TracedT t w) where - track t tr = extract (runTracedT tr) t \ No newline at end of file + track t tr = extract (runTracedT tr) t diff --git a/src/Control/Monad/Reader.purs b/src/Control/Monad/Reader.purs index f7293ef4..040e3278 100644 --- a/src/Control/Monad/Reader.purs +++ b/src/Control/Monad/Reader.purs @@ -1,6 +1,6 @@ -- | This module defines the `Reader` monad. -module Control.Monad.Reader +module Control.Monad.Reader ( Reader() , runReader , mapReader @@ -24,7 +24,7 @@ runReader :: forall r a. Reader r a -> r -> a runReader m = runIdentity <<< runReaderT m -- | Change the type of the context in a `Reader` monad action. -withReader :: forall r1 r2 a b. (r2 -> r1) -> Reader r1 a -> Reader r2 a +withReader :: forall r1 r2 a. (r2 -> r1) -> Reader r1 a -> Reader r2 a withReader = withReaderT -- | Change the type of the result in a `Reader` monad action. diff --git a/src/Control/Monad/Reader/Trans.purs b/src/Control/Monad/Reader/Trans.purs index 04a87219..a8fb3363 100644 --- a/src/Control/Monad/Reader/Trans.purs +++ b/src/Control/Monad/Reader/Trans.purs @@ -1,6 +1,6 @@ -- | This module defines the reader monad transformer, `ReaderT`. -module Control.Monad.Reader.Trans +module Control.Monad.Reader.Trans ( ReaderT(..), runReaderT, withReaderT, mapReaderT , module Control.Monad.Trans , 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 mapReaderT f m = ReaderT $ f <<< runReaderT m -- | Change the type of the context in a `ReaderT` monad action. -withReaderT :: forall r1 r2 m a b. (r2 -> r1) -> ReaderT r1 m a -> ReaderT r2 m a +withReaderT :: forall r1 r2 m a. (r2 -> r1) -> ReaderT r1 m a -> ReaderT r2 m a withReaderT f m = ReaderT $ runReaderT m <<< f instance functorReaderT :: (Functor m) => Functor (ReaderT r m) where @@ -90,7 +90,7 @@ instance monadReaderReaderT :: (Monad m) => MonadReader r (ReaderT r m) where instance monadStateReaderT :: (MonadState s m) => MonadState s (ReaderT r m) where state f = lift (state f) - + instance monadWriterReaderT :: (Monad m, MonadWriter w m) => MonadWriter w (ReaderT r m) where writer wd = lift (writer wd) listen = mapReaderT listen diff --git a/src/Control/Monad/Writer/Class.purs b/src/Control/Monad/Writer/Class.purs index c2220b1b..c185b5ca 100644 --- a/src/Control/Monad/Writer/Class.purs +++ b/src/Control/Monad/Writer/Class.purs @@ -30,7 +30,7 @@ class (Monad m) <= MonadWriter w m where pass :: forall a. m (Tuple a (w -> w)) -> m a -- | Append a value to the accumulator. -tell :: forall w m a. (Monoid w, Monad m, MonadWriter w m) => w -> m Unit +tell :: forall w m. (Monoid w, Monad m, MonadWriter w m) => w -> m Unit tell w = writer $ Tuple unit w -- | Read a value which depends on the modifications made to the accumulator during an action.