diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 Changelog for Extra
 
+1.4.2
+    Make concatMapM/mapMaybeM faster
 1.4.1
     Make temp file functions workaround GHC bug #10731
     Add retryBool
diff --git a/extra.cabal b/extra.cabal
--- a/extra.cabal
+++ b/extra.cabal
@@ -1,7 +1,7 @@
 cabal-version:      >= 1.10
 build-type:         Simple
 name:               extra
-version:            1.4.1
+version:            1.4.2
 license:            BSD3
 license-file:       LICENSE
 category:           Development
diff --git a/src/Control/Monad/Extra.hs b/src/Control/Monad/Extra.hs
--- a/src/Control/Monad/Extra.hs
+++ b/src/Control/Monad/Extra.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE UnboxedTuples #-}
 
 -- | Extra functions for "Control.Monad".
 --   These functions provide looping, list operations and booleans.
@@ -13,14 +13,13 @@
     -- * Lists
     partitionM, concatMapM, mapMaybeM, findM, firstJustM,
     -- * Booleans
-    whenM, unlessM, ifM, notM, (||^), (&&^), orM, andM, anyM, allM,
+    whenM, unlessM, ifM, notM, (||^), (&&^), orM, andM, anyM, allM
     ) where
 
 import Control.Monad
-#if __GLASGOW_HASKELL__ < 709
 import Control.Applicative
-#endif
 import Data.Maybe
+import Prelude
 
 -- General utilities
 
@@ -58,11 +57,15 @@
 
 -- | A version of 'concatMap' that works with a monadic predicate.
 concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
-concatMapM f = liftM concat . mapM f
+{-# INLINE concatMapM #-}
+concatMapM op = foldr f (return [])
+    where f x xs = do x <- op x; if null x then xs else do xs <- xs; return $ x++xs
 
 -- | A version of 'mapMaybe' that works with a monadic predicate.
 mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
-mapMaybeM f = liftM catMaybes . mapM f
+{-# INLINE mapMaybeM #-}
+mapMaybeM op = foldr f (return [])
+    where f x xs = do x <- op x; case x of Nothing -> xs; Just x -> do xs <- xs; return $ x:xs
 
 -- Looping
 
diff --git a/src/System/IO/Extra.hs b/src/System/IO/Extra.hs
--- a/src/System/IO/Extra.hs
+++ b/src/System/IO/Extra.hs
@@ -127,7 +127,7 @@
                 hSetBuffering out buf
 
 
--- | Execute an action with a custom 'BufferMode', a warpper around
+-- | Execute an action with a custom 'BufferMode', a wrapper around
 --   'hSetBuffering'.
 withBuffering :: Handle -> BufferMode -> IO a -> IO a
 withBuffering h m act = bracket (hGetBuffering h) (hSetBuffering h) $ const $ do
@@ -141,7 +141,7 @@
 {-# NOINLINE tempRef #-}
 tempRef :: IORef Int
 tempRef = unsafePerformIO $ do
-    rand :: Integer <- fmap (read . take 50 . filter isDigit . show . utctDayTime) getCurrentTime
+    rand :: Integer <- fmap (read . reverse . filter isDigit . show . utctDayTime) getCurrentTime
     newIORef $ fromIntegral rand
 
 tempUnique :: IO Int
