X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FException.lhs;h=073e7a97c9ed60a74615c259a93252fe69f14e2b;hb=1fd0b9560f30181af709c784f70017e36a97d4da;hp=04f732a886f6b8bb56196a125ab72862ecafcc13;hpb=19de173b1bd4fa8cf1854cfefa619565910137f3;p=haskell-directory.git diff --git a/GHC/Exception.lhs b/GHC/Exception.lhs index 04f732a..073e7a9 100644 --- a/GHC/Exception.lhs +++ b/GHC/Exception.lhs @@ -1,5 +1,5 @@ \begin{code} -{-# OPTIONS -fno-implicit-prelude #-} +{-# OPTIONS_GHC -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Exception @@ -14,6 +14,7 @@ -- ----------------------------------------------------------------------------- +-- #hide module GHC.Exception ( module GHC.Exception, Exception(..), AsyncException(..), @@ -105,10 +106,12 @@ unblock (IO io) = IO $ unblockAsyncExceptions# io -- the 'IO' monad. It can be used to order evaluation with respect to -- other 'IO' operations; its semantics are given by -- --- > evaluate undefined `seq` return () ==> return () --- > catch (evaluate undefined) (\e -> return ()) ==> return () +-- > evaluate x `seq` y ==> y +-- > evaluate x `catch` f ==> (return $! x) `catch` f +-- > evaluate x >>= f ==> (return $! x) >>= f -- --- NOTE: @(evaluate a)@ is /not/ the same as @(a \`seq\` return a)@. +-- /Note:/ the first equation implies that @(evaluate x)@ is /not/ the +-- same as @(return $! x)@. evaluate :: a -> IO a evaluate a = IO $ \s -> case a `seq` () of () -> (# s, a #) -- NB. can't write