Skip to content

Commit bc810c5

Browse files
committed
remove explicit return definitions
1 parent 9d7f203 commit bc810c5

17 files changed

Lines changed: 0 additions & 69 deletions

File tree

Control/Monad/Trans/Accum.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ instance (Monoid w, Functor m, MonadPlus m) => Alternative (AccumT w m) where
200200
{-# INLINE (<|>) #-}
201201

202202
instance (Monoid w, Functor m, Monad m) => Monad (AccumT w m) where
203-
#if !(MIN_VERSION_base(4,8,0))
204-
return a = AccumT $ const $ return (a, mempty)
205-
{-# INLINE return #-}
206-
#endif
207203
m >>= k = AccumT $ \ w -> do
208204
~(a, w') <- runAccumT m w
209205
~(b, w'') <- runAccumT (k a) (w `mappend` w')

Control/Monad/Trans/Cont.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ instance Applicative (ContT r m) where
176176
{-# INLINE (*>) #-}
177177

178178
instance Monad (ContT r m) where
179-
#if !(MIN_VERSION_base(4,8,0))
180-
return x = ContT ($ x)
181-
{-# INLINE return #-}
182-
#endif
183179
m >>= k = ContT $ \ c -> runContT m (\ x -> runContT (k x) c)
184180
{-# INLINE (>>=) #-}
185181

Control/Monad/Trans/Except.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,6 @@ instance (Functor m, Monad m, Monoid e) => Alternative (ExceptT e m) where
214214
{-# INLINEABLE (<|>) #-}
215215

216216
instance (Monad m) => Monad (ExceptT e m) where
217-
#if !(MIN_VERSION_base(4,8,0))
218-
return a = ExceptT $ return (Right a)
219-
{-# INLINE return #-}
220-
#endif
221217
m >>= k = ExceptT $ do
222218
a <- runExceptT m
223219
case a of

Control/Monad/Trans/Identity.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ instance (Alternative m) => Alternative (IdentityT m) where
123123
{-# INLINE (<|>) #-}
124124

125125
instance (Monad m) => Monad (IdentityT m) where
126-
#if !(MIN_VERSION_base(4,8,0))
127-
return = IdentityT . return
128-
{-# INLINE return #-}
129-
#endif
130126
m >>= k = IdentityT $ runIdentityT . k =<< runIdentityT m
131127
{-# INLINE (>>=) #-}
132128
#if !(MIN_VERSION_base(4,13,0))

Control/Monad/Trans/Maybe.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ instance (Functor m, Monad m) => Alternative (MaybeT m) where
162162
{-# INLINE (<|>) #-}
163163

164164
instance (Monad m) => Monad (MaybeT m) where
165-
#if !(MIN_VERSION_base(4,8,0))
166-
return = MaybeT . return . Just
167-
{-# INLINE return #-}
168-
#endif
169165
x >>= f = MaybeT $ do
170166
v <- runMaybeT x
171167
case v of

Control/Monad/Trans/RWS/CPS.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,6 @@ instance (Functor m, MonadPlus m) => Alternative (RWST r w s m) where
225225
{-# INLINE (<|>) #-}
226226

227227
instance (Monad m) => Monad (RWST r w s m) where
228-
#if !(MIN_VERSION_base(4,8,0))
229-
return a = RWST $ \ _ s w -> return (a, s, w)
230-
{-# INLINE return #-}
231-
#endif
232-
233228
m >>= k = RWST $ \ r s w -> do
234229
(a, s', w') <- unRWST m r s w
235230
unRWST (k a) r s' w'

Control/Monad/Trans/RWS/Lazy.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ instance (Monoid w, Functor m, MonadPlus m) => Alternative (RWST r w s m) where
199199
{-# INLINE (<|>) #-}
200200

201201
instance (Monoid w, Monad m) => Monad (RWST r w s m) where
202-
#if !(MIN_VERSION_base(4,8,0))
203-
return a = RWST $ \ _ s -> return (a, s, mempty)
204-
{-# INLINE return #-}
205-
#endif
206202
m >>= k = RWST $ \ r s -> do
207203
~(a, s', w) <- runRWST m r s
208204
~(b, s'',w') <- runRWST (k a) r s'

Control/Monad/Trans/RWS/Strict.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ instance (Monoid w, Functor m, MonadPlus m) => Alternative (RWST r w s m) where
203203
{-# INLINE (<|>) #-}
204204

205205
instance (Monoid w, Monad m) => Monad (RWST r w s m) where
206-
#if !(MIN_VERSION_base(4,8,0))
207-
return a = RWST $ \ _ s -> return (a, s, mempty)
208-
{-# INLINE return #-}
209-
#endif
210206
m >>= k = RWST $ \ r s -> do
211207
(a, s', w) <- runRWST m r s
212208
(b, s'',w') <- runRWST (k a) r s'

Control/Monad/Trans/Reader.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ instance (Alternative m) => Alternative (ReaderT r m) where
162162
{-# INLINE (<|>) #-}
163163

164164
instance (Monad m) => Monad (ReaderT r m) where
165-
#if !(MIN_VERSION_base(4,8,0))
166-
return = lift . return
167-
{-# INLINE return #-}
168-
#endif
169165
m >>= k = ReaderT $ \ r -> do
170166
a <- runReaderT m r
171167
runReaderT (k a) r

Control/Monad/Trans/Select.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ instance (Functor m, MonadPlus m) => Alternative (SelectT r m) where
117117
{-# INLINE (<|>) #-}
118118

119119
instance (Monad m) => Monad (SelectT r m) where
120-
#if !(MIN_VERSION_base(4,8,0))
121-
return = lift . return
122-
{-# INLINE return #-}
123-
#endif
124120
SelectT g >>= f = SelectT $ \ k -> do
125121
let h x = runSelectT (f x) k
126122
y <- g ((>>= k) . h)

0 commit comments

Comments
 (0)