[project @ 2002-02-27 14:31:44 by simonmar]
[ghc-base.git] / GHC / Conc.lhs
index 57daaf8..5a74f32 100644 (file)
@@ -1,5 +1,5 @@
 % -----------------------------------------------------------------------------
-% $Id: Conc.lhs,v 1.1 2001/06/28 14:15:03 simonmar Exp $
+% $Id: Conc.lhs,v 1.3 2001/12/21 15:07:22 simonmar Exp $
 %
 % (c) The University of Glasgow, 1994-2000
 %
@@ -19,7 +19,7 @@ module GHC.Conc
        , killThread    -- :: ThreadId -> IO ()
        , throwTo       -- :: ThreadId -> Exception -> IO ()
        , par           -- :: a -> b -> b
-       , seq           -- :: a -> b -> b
+       , pseq          -- :: a -> b -> b
        , yield         -- :: IO ()
 
        -- Waiting
@@ -40,14 +40,15 @@ module GHC.Conc
 
     ) where
 
+import Data.Maybe
+
 import GHC.Base
-import GHC.Maybe
 import GHC.Err         ( parError, seqError )
 import GHC.IOBase      ( IO(..), MVar(..) )
 import GHC.Base                ( Int(..) )
 import GHC.Exception    ( Exception(..), AsyncException(..) )
 
-infixr 0 `par`, `seq`
+infixr 0 `par`, `pseq`
 \end{code}
 
 %************************************************************************
@@ -80,7 +81,10 @@ yield :: IO ()
 yield = IO $ \s -> 
    case (yield# s) of s1 -> (# s1, () #)
 
--- "seq" is defined a bit weirdly (see below)
+--     Nota Bene: 'pseq' used to be 'seq'
+--                but 'seq' is now defined in PrelGHC
+--
+-- "pseq" is defined a bit weirdly (see below)
 --
 -- The reason for the strange "0# -> parError" case is that
 -- it fools the compiler into thinking that seq is non-strict in
@@ -91,9 +95,9 @@ yield = IO $ \s ->
 -- Just before converting from Core to STG there's a bit of magic
 -- that recognises the seq# and eliminates the duff case.
 
-{-# INLINE seq  #-}
-seq :: a -> b -> b
-seq  x y = case (seq#  x) of { 0# -> seqError; _ -> y }
+{-# INLINE pseq  #-}
+pseq :: a -> b -> b
+pseq  x y = case (seq#  x) of { 0# -> seqError; _ -> y }
 
 {-# INLINE par  #-}
 par :: a -> b -> b