Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Control/Monad/Trans/Accum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ instance (Monoid w, Monad m) => Applicative (AccumT w m) where
return (f v, w' `mappend` w'')
{-# INLINE (<*>) #-}

instance (Monoid w, MonadPlus m) => Alternative (AccumT w m) where
empty = AccumT $ const mzero
instance (Monoid w, Alternative m, Monad m) => Alternative (AccumT w m) where
empty = AccumT $ const empty
{-# INLINE empty #-}
m <|> n = AccumT $ \ w -> runAccumT m w `mplus` runAccumT n w
m <|> n = AccumT $ \ w -> runAccumT m w <|> runAccumT n w
{-# INLINE (<|>) #-}

instance (Monoid w, Monad m) => Monad (AccumT w m) where
Expand Down
2 changes: 0 additions & 2 deletions Control/Monad/Trans/Except.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ import Control.Monad
import qualified Control.Monad.Fail as Fail
import Control.Monad.Fix
import Control.Monad.Zip (MonadZip(mzipWith))
import Data.Foldable (Foldable(foldMap))
import Data.Traversable (Traversable(traverse))
#ifdef __GLASGOW_HASKELL__
import GHC.Generics
#endif
Expand Down
1 change: 0 additions & 1 deletion Control/Monad/Trans/Identity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import qualified Control.Monad.Fail as Fail
import Control.Monad.Fix (MonadFix(mfix))
import Control.Monad.Zip (MonadZip(mzipWith))
import Data.Foldable
import Data.Traversable (Traversable(traverse))
import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
#ifdef __GLASGOW_HASKELL__
import GHC.Generics
Expand Down
2 changes: 0 additions & 2 deletions Control/Monad/Trans/Maybe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ import qualified Control.Monad.Fail as Fail
import Control.Monad.Fix (MonadFix(mfix))
import Control.Monad.Zip (MonadZip(mzipWith))
import Data.Maybe (fromMaybe)
import Data.Foldable (Foldable(foldMap))
import Data.Traversable (Traversable(traverse))
#ifdef __GLASGOW_HASKELL__
import GHC.Generics
#endif
Expand Down
6 changes: 3 additions & 3 deletions Control/Monad/Trans/RWS/CPS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ instance (Monad m) => Applicative (RWST r w s m) where
return (f x, s'', w'')
{-# INLINE (<*>) #-}

instance (MonadPlus m) => Alternative (RWST r w s m) where
empty = RWST $ \ _ _ _ -> mzero
instance (Alternative m, Monad m) => Alternative (RWST r w s m) where
empty = RWST $ \ _ _ _ -> empty
{-# INLINE empty #-}

RWST m <|> RWST n = RWST $ \ r s w -> m r s w `mplus` n r s w
RWST m <|> RWST n = RWST $ \ r s w -> m r s w <|> n r s w
{-# INLINE (<|>) #-}

instance (Monad m) => Monad (RWST r w s m) where
Expand Down
6 changes: 3 additions & 3 deletions Control/Monad/Trans/RWS/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ instance (Monoid w, Monad m) => Applicative (RWST r w s m) where
return (f x, s'', w `mappend` w')
{-# INLINE (<*>) #-}

instance (Monoid w, MonadPlus m) => Alternative (RWST r w s m) where
empty = RWST $ \ _ _ -> mzero
instance (Monoid w, Alternative m, Monad m) => Alternative (RWST r w s m) where
empty = RWST $ \ _ _ -> empty
{-# INLINE empty #-}
RWST m <|> RWST n = RWST $ \ r s -> m r s `mplus` n r s
RWST m <|> RWST n = RWST $ \ r s -> m r s <|> n r s
{-# INLINE (<|>) #-}

instance (Monoid w, Monad m) => Monad (RWST r w s m) where
Expand Down
6 changes: 3 additions & 3 deletions Control/Monad/Trans/RWS/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ instance (Monoid w, Monad m) => Applicative (RWST r w s m) where
return (f x, s'', w `mappend` w')
{-# INLINE (<*>) #-}

instance (Monoid w, MonadPlus m) => Alternative (RWST r w s m) where
empty = RWST $ \ _ _ -> mzero
instance (Monoid w, Alternative m, Monad m) => Alternative (RWST r w s m) where
empty = RWST $ \ _ _ -> empty
{-# INLINE empty #-}
RWST m <|> RWST n = RWST $ \ r s -> m r s `mplus` n r s
RWST m <|> RWST n = RWST $ \ r s -> m r s <|> n r s
{-# INLINE (<|>) #-}

instance (Monoid w, Monad m) => Monad (RWST r w s m) where
Expand Down
6 changes: 3 additions & 3 deletions Control/Monad/Trans/Select.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ instance (Monad m) => Applicative (SelectT r m) where
m *> k = m >>= \_ -> k
{-# INLINE (*>) #-}

instance (MonadPlus m) => Alternative (SelectT r m) where
empty = mzero
instance (Alternative m, Monad m) => Alternative (SelectT r m) where
empty = empty
{-# INLINE empty #-}
(<|>) = mplus
(<|>) = (<|>)
{-# INLINE (<|>) #-}

instance (Monad m) => Monad (SelectT r m) where
Expand Down
6 changes: 3 additions & 3 deletions Control/Monad/Trans/State/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ instance (Monad m) => Applicative (StateT s m) where
m *> k = m >>= \_ -> k
{-# INLINE (*>) #-}

instance (MonadPlus m) => Alternative (StateT s m) where
empty = StateT $ \ _ -> mzero
instance (Alternative m, Monad m) => Alternative (StateT s m) where
empty = StateT $ \ _ -> empty
{-# INLINE empty #-}
StateT m <|> StateT n = StateT $ \ s -> m s `mplus` n s
StateT m <|> StateT n = StateT $ \ s -> m s <|> n s
{-# INLINE (<|>) #-}

instance (Monad m) => Monad (StateT s m) where
Expand Down
6 changes: 3 additions & 3 deletions Control/Monad/Trans/State/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ instance (Monad m) => Applicative (StateT s m) where
m *> k = m >>= \_ -> k
{-# INLINE (*>) #-}

instance (MonadPlus m) => Alternative (StateT s m) where
empty = StateT $ \ _ -> mzero
instance (Alternative m, Monad m) => Alternative (StateT s m) where
empty = StateT $ \ _ -> empty
{-# INLINE empty #-}
StateT m <|> StateT n = StateT $ \ s -> m s `mplus` n s
StateT m <|> StateT n = StateT $ \ s -> m s <|> n s
{-# INLINE (<|>) #-}

instance (Monad m) => Monad (StateT s m) where
Expand Down
6 changes: 3 additions & 3 deletions Control/Monad/Trans/Writer/CPS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ instance (Monad m) => Applicative (WriterT w m) where
return (f x, w'')
{-# INLINE (<*>) #-}

instance (MonadPlus m) => Alternative (WriterT w m) where
empty = WriterT $ const mzero
instance (Alternative m, Monad m) => Alternative (WriterT w m) where
empty = WriterT $ const empty
{-# INLINE empty #-}

WriterT m <|> WriterT n = WriterT $ \ w -> m w `mplus` n w
WriterT m <|> WriterT n = WriterT $ \ w -> m w <|> n w
{-# INLINE (<|>) #-}

instance (Monad m) => Monad (WriterT w m) where
Expand Down
1 change: 0 additions & 1 deletion Control/Monad/Trans/Writer/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import Control.Monad.Fix
import Control.Monad.Signatures
import Control.Monad.Zip (MonadZip(mzipWith))
import Data.Foldable
import Data.Traversable (Traversable(traverse))
import Prelude hiding (null, length)
#ifdef __GLASGOW_HASKELL__
import GHC.Generics
Expand Down
1 change: 0 additions & 1 deletion Control/Monad/Trans/Writer/Strict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import Control.Monad.Fix
import Control.Monad.Signatures
import Control.Monad.Zip (MonadZip(mzipWith))
import Data.Foldable
import Data.Traversable (Traversable(traverse))
import Prelude hiding (null, length)
#ifdef __GLASGOW_HASKELL__
import GHC.Generics
Expand Down
1 change: 0 additions & 1 deletion Data/Functor/Reverse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import Control.Applicative
import Control.Monad
import qualified Control.Monad.Fail as Fail
import Data.Foldable
import Data.Traversable (Traversable(traverse))
import Data.Monoid (Dual (..))
#ifdef __GLASGOW_HASKELL__
import GHC.Generics
Expand Down
Loading