Refactor the FPTOOLS_CHECK_HTYPE macro
[ghc-base.git] / GHC / ST.lhs
index e3e24bf..a66a5f8 100644 (file)
@@ -1,5 +1,5 @@
 \begin{code}
-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE NoImplicitPrelude, MagicHash, UnboxedTuples, Rank2Types #-}
 {-# OPTIONS_HADDOCK hide #-}
 -----------------------------------------------------------------------------
 -- |
@@ -20,6 +20,7 @@ module GHC.ST where
 
 import GHC.Base
 import GHC.Show
+import Control.Monad( forever )
 
 default ()
 \end{code}
@@ -74,6 +75,9 @@ instance Monad (ST s) where
 
 data STret s a = STret (State# s) a
 
+{-# SPECIALISE forever :: ST s a -> ST s b #-}
+-- See Note [Make forever INLINABLE] in Control.Monad
+
 -- liftST is useful when we want a lifted result from an ST computation.  See
 -- fixST below.
 liftST :: ST s a -> State# s -> STret s a