+import IO ( bracket )
+#elif defined(__HUGS__)
+import Control.Exception ( bracket )
+#endif
+
+#ifdef __GLASGOW_HASKELL__
+import GHC.Base ( Int, Monad(..), (.), not, map )
+import GHC.Err ( undefined )
+import GHC.Exception ( block, unblock, throw, catchException )
+import GHC.IOBase ( IO, IORef, newIORef, readIORef, writeIORef, )
+import GHC.List ( elem, length )
+import GHC.Num ( Num(..) )