diff options
Diffstat (limited to 'libraries/base/GHC')
-rw-r--r-- | libraries/base/GHC/Base.lhs | 6 | ||||
-rw-r--r-- | libraries/base/GHC/Event/Manager.hs | 2 | ||||
-rw-r--r-- | libraries/base/GHC/Event/Poll.hsc | 2 | ||||
-rw-r--r-- | libraries/base/GHC/Event/TimerManager.hs | 2 | ||||
-rw-r--r-- | libraries/base/GHC/Stack.hsc | 2 |
5 files changed, 9 insertions, 5 deletions
diff --git a/libraries/base/GHC/Base.lhs b/libraries/base/GHC/Base.lhs index 54ba3486c7..14a6957454 100644 --- a/libraries/base/GHC/Base.lhs +++ b/libraries/base/GHC/Base.lhs @@ -121,6 +121,7 @@ infixr 9 . infixr 5 ++ infixl 4 <$ infixl 1 >>, >>= +infixr 1 =<< infixr 0 $, $! infixl 4 <*>, <*, *>, <**> @@ -487,6 +488,11 @@ original default. -} +-- | Same as '>>=', but with the arguments interchanged. +{-# SPECIALISE (=<<) :: (a -> [b]) -> [a] -> [b] #-} +(=<<) :: Monad m => (a -> m b) -> m a -> m b +f =<< x = x >>= f + -- | Promote a function to a monad. liftM :: (Monad m) => (a1 -> r) -> m a1 -> m r liftM f m1 = do { x1 <- m1; return (f x1) } diff --git a/libraries/base/GHC/Event/Manager.hs b/libraries/base/GHC/Event/Manager.hs index 9f12ecd9dc..b6c028a9e1 100644 --- a/libraries/base/GHC/Event/Manager.hs +++ b/libraries/base/GHC/Event/Manager.hs @@ -52,7 +52,7 @@ module GHC.Event.Manager import Control.Concurrent.MVar (MVar, newMVar, readMVar, putMVar, tryPutMVar, takeMVar, withMVar) import Control.Exception (onException) -import Control.Monad ((=<<), forM_, when, replicateM, void) +import Control.Monad (forM_, when, replicateM, void) import Data.Bits ((.&.)) import Data.IORef (IORef, atomicModifyIORef', mkWeakIORef, newIORef, readIORef, writeIORef) diff --git a/libraries/base/GHC/Event/Poll.hsc b/libraries/base/GHC/Event/Poll.hsc index fd05a13799..686bc711da 100644 --- a/libraries/base/GHC/Event/Poll.hsc +++ b/libraries/base/GHC/Event/Poll.hsc @@ -26,7 +26,7 @@ available = False #include <poll.h> import Control.Concurrent.MVar (MVar, newMVar, swapMVar) -import Control.Monad ((=<<), unless) +import Control.Monad (unless) import Data.Bits (Bits, FiniteBits, (.|.), (.&.)) import Data.Word import Foreign.C.Types (CInt(..), CShort(..)) diff --git a/libraries/base/GHC/Event/TimerManager.hs b/libraries/base/GHC/Event/TimerManager.hs index 435693a927..e55dddf82a 100644 --- a/libraries/base/GHC/Event/TimerManager.hs +++ b/libraries/base/GHC/Event/TimerManager.hs @@ -39,7 +39,7 @@ module GHC.Event.TimerManager -- Imports import Control.Exception (finally) -import Control.Monad ((=<<), sequence_, when) +import Control.Monad (sequence_, when) import Data.IORef (IORef, atomicModifyIORef', mkWeakIORef, newIORef, readIORef, writeIORef) import GHC.Base diff --git a/libraries/base/GHC/Stack.hsc b/libraries/base/GHC/Stack.hsc index 0b30391cdc..91fddfb558 100644 --- a/libraries/base/GHC/Stack.hsc +++ b/libraries/base/GHC/Stack.hsc @@ -34,8 +34,6 @@ module GHC.Stack ( renderStack ) where -import Control.Monad ( (=<<) ) - import Foreign import Foreign.C |