From: Ross Paterson Date: Tue, 15 Jul 2008 12:55:21 +0000 (+0000) Subject: fix dummy async implementations for non-GHC X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=4c02acd990ad9d695d66279a9c385d9bcbb2c19c;p=ghc-base.git fix dummy async implementations for non-GHC --- diff --git a/Control/Exception.hs b/Control/Exception.hs index bd997b1..de1fc21 100644 --- a/Control/Exception.hs +++ b/Control/Exception.hs @@ -180,16 +180,20 @@ userErrors :: Exception -> Maybe String userErrors (UserError _ s) = Just s userErrors _ = Nothing +assert :: Bool -> a -> a +assert True x = x +assert False _ = throw (UserError "" "Assertion failed") +#endif + +#ifndef __GLASGOW_HASKELL__ +-- Dummy definitions for implementations lacking asynchonous exceptions + block :: IO a -> IO a block = id unblock :: IO a -> IO a unblock = id blocked :: IO Bool -blocked = False - -assert :: Bool -> a -> a -assert True x = x -assert False _ = throw (UserError "" "Assertion failed") +blocked = return False #endif -----------------------------------------------------------------------------