A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/src/System-IO-Unsafe.html below:

System/IO/Unsafe.hs


















module System.IO.Unsafe (
   
   unsafePerformIO,     
   unsafeDupablePerformIO, 
   unsafeInterleaveIO,  
   unsafeFixIO,
  ) where

#ifdef __GLASGOW_HASKELL__
import GHC.Base
import GHC.IO
import GHC.IORef
import GHC.Exception
import Control.Exception
#endif

#ifdef __HUGS__
import Hugs.IOExts (unsafePerformIO, unsafeInterleaveIO)
unsafeDupablePerformIO = unsafePerformIO
#endif

#ifdef __NHC__
import NHC.Internal (unsafePerformIO, unsafeInterleaveIO)
unsafeDupablePerformIO = unsafePerformIO
#endif












unsafeFixIO :: (a -> IO a) -> IO a
unsafeFixIO k = do
  ref <- newIORef (throw NonTermination)
  ans <- unsafeDupableInterleaveIO (readIORef ref)
  result <- k ans
  writeIORef ref result
  return result

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4