Skip to content
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
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
Loading