Skip to content

Commit

Permalink
Fix import warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed Nov 19, 2015
1 parent 25935d1 commit 0704650
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 34 deletions.
1 change: 0 additions & 1 deletion src/Control/Comonad/Env/Class.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module Control.Comonad.Env.Class where
import Prelude

import Control.Comonad
import Control.Comonad.Env
import Control.Comonad.Env.Trans

import Data.Tuple
Expand Down
1 change: 0 additions & 1 deletion src/Control/Comonad/Traced/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Control.Comonad.Trans
import Control.Extend

import Data.Monoid
import Data.Tuple

-- | The cowriter comonad transformer.
-- |
Expand Down
29 changes: 13 additions & 16 deletions src/Control/Monad/Except/Trans.purs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- | This module defines the _exception monad transformer_ `ExceptT`.

module Control.Monad.Except.Trans
module Control.Monad.Except.Trans
( ExceptT(..), runExceptT, withExceptT, mapExceptT
, module Control.Monad.Trans
, module Control.Monad.Error.Class
) where

import Prelude
import Prelude

import Data.Tuple (Tuple(..))
import Data.Either (Either(..), either)
Expand All @@ -18,9 +18,6 @@ import Control.Monad.Rec.Class (MonadRec, tailRecM)
import Control.Monad.Eff.Class (MonadEff, liftEff)
import Control.Monad.Error.Class (MonadError, throwError, catchError)
import Control.Monad.Cont.Class (MonadCont, callCC)
import Control.Monad.Reader.Class
import Control.Monad.State.Class
import Control.Monad.Writer.Class
import Control.Monad.RWS.Class
import Control.Monad.Trans
import Control.MonadPlus (MonadPlus)
Expand Down Expand Up @@ -99,29 +96,29 @@ instance monadTransExceptT :: MonadTrans (ExceptT e) where
instance monadEffExceptT :: (MonadEff eff m) => MonadEff eff (ExceptT e m) where
liftEff = lift <<< liftEff

instance monadContExceptT :: (MonadCont m) => MonadCont (ExceptT e m) where
instance monadContExceptT :: (MonadCont m) => MonadCont (ExceptT e m) where
callCC f = ExceptT $ callCC $ \c -> runExceptT (f (\a -> ExceptT $ c (Right a)))

instance monadErrorExceptT :: (Monad m) => MonadError e (ExceptT e m) where
throwError = ExceptT <<< pure <<< Left
catchError m handler = ExceptT (runExceptT m >>= either (runExceptT <<< handler) (pure <<< Right))

instance monadReaderExceptT :: (MonadReader r m) => MonadReader r (ExceptT e m) where
ask = lift ask
ask = lift ask
local f = mapExceptT (local f)

instance monadStateExceptT :: (MonadState s m) => MonadState s (ExceptT e m) where
state f = lift (state f)

instance monadWriterExceptT :: (MonadWriter w m) => MonadWriter w (ExceptT e m) where
writer wd = lift (writer wd)
listen = mapExceptT $ \m -> do
Tuple a w <- listen m
instance monadWriterExceptT :: (MonadWriter w m) => MonadWriter w (ExceptT e m) where
writer wd = lift (writer wd)
listen = mapExceptT $ \m -> do
Tuple a w <- listen m
return $ (\r -> Tuple r w) <$> a
pass = mapExceptT $ \m -> pass $ do
a <- m
return $ case a of
Left e -> Tuple (Left e) id
Right (Tuple r f) -> Tuple (Right r) f
pass = mapExceptT $ \m -> pass $ do
a <- m
return $ case a of
Left e -> Tuple (Left e) id
Right (Tuple r f) -> Tuple (Right r) f

instance monadRWSExceptT :: (Monoid w, MonadRWS r w s m) => MonadRWS r w s (ExceptT e m)
10 changes: 3 additions & 7 deletions src/Control/Monad/Maybe/Trans.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- | This module defines the `MaybeT` monad transformer.

module Control.Monad.Maybe.Trans
module Control.Monad.Maybe.Trans
( MaybeT(..), runMaybeT, mapMaybeT
, module Control.Monad.Trans
) where
Expand All @@ -14,15 +14,11 @@ import Data.Monoid

import Control.Alt
import Control.Alternative
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Rec.Class
import Control.Monad.Eff.Class
import Control.Monad.Cont.Class
import Control.Monad.Error.Class
import Control.Monad.Reader.Class
import Control.Monad.Writer.Class
import Control.Monad.State.Class
import Control.Monad.RWS.Class
import Control.MonadPlus
import Control.Plus
Expand Down Expand Up @@ -86,7 +82,7 @@ instance monadRecMaybeT :: (MonadRec m) => MonadRec (MaybeT m) where

instance monadEffMaybe :: (MonadEff eff m) => MonadEff eff (MaybeT m) where
liftEff = lift <<< liftEff

instance monadContMaybeT :: (MonadCont m) => MonadCont (MaybeT m) where
callCC f = MaybeT $ callCC $ \c -> runMaybeT (f (\a -> MaybeT $ c $ Just a))

Expand All @@ -112,4 +108,4 @@ instance monadWriterMaybeT :: (Monad m, MonadWriter w m) => MonadWriter w (Maybe
Nothing -> Tuple Nothing id
Just (Tuple v f) -> Tuple (Just v) f

instance monadRWSMaybeT :: (Monoid w, MonadRWS r w s m) => MonadRWS r w s (MaybeT m)
instance monadRWSMaybeT :: (Monoid w, MonadRWS r w s m) => MonadRWS r w s (MaybeT m)
3 changes: 1 addition & 2 deletions src/Control/Monad/RWS.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- | This module defines the `RWS` monad.

module Control.Monad.RWS
module Control.Monad.RWS
( RWS()
, rws
, runRWS
Expand All @@ -14,7 +14,6 @@ module Control.Monad.RWS
import Prelude

import Data.Identity
import Data.Monoid
import Data.Tuple

import Control.Monad.RWS.Class
Expand Down
3 changes: 0 additions & 3 deletions src/Control/Monad/RWS/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import Control.Monad.Eff.Class
import Control.Monad.Error.Class
import Control.Monad.RWS.Class
import Control.Monad.Rec.Class
import Control.Monad.Reader.Class
import Control.Monad.State.Class
import Control.Monad.Trans
import Control.Monad.Writer.Class

data RWSResult state result writer = RWSResult state result writer

Expand Down
1 change: 0 additions & 1 deletion src/Control/Monad/State/Class.purs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Control.Monad.State.Class where

import Prelude

import Data.Monoid
import Data.Tuple

-- | The `MonadState s` type class represents those monads which support a single piece of mutable
Expand Down
5 changes: 2 additions & 3 deletions src/Control/Monad/Writer.purs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
-- | This module defines the `Writer` monad.

module Control.Monad.Writer
module Control.Monad.Writer
( Writer()
, runWriter
, execWriter
, mapWriter
, module Control.Monad.Writer.Class
) where

import Prelude

import Data.Identity
import Data.Monoid
import Data.Tuple

import Control.Monad.Writer.Class
Expand Down

0 comments on commit 0704650

Please sign in to comment.