[project @ 1997-11-11 14:32:34 by simonm]
authorsimonm <unknown>
Tue, 11 Nov 1997 14:34:23 +0000 (14:34 +0000)
committersimonm <unknown>
Tue, 11 Nov 1997 14:34:23 +0000 (14:34 +0000)
Library changes to:

* remove PrimIO
* change type of _ccall_ to IO
* incorporate Alastair Reid's new library interfaces for
  compatibility with Hugs.

46 files changed:
ghc/lib/.depend
ghc/lib/concurrent/Channel.lhs
ghc/lib/concurrent/ChannelVar.lhs
ghc/lib/concurrent/Merge.lhs
ghc/lib/concurrent/SampleVar.lhs
ghc/lib/ghc/ArrBase.lhs
ghc/lib/ghc/ConcBase.lhs
ghc/lib/ghc/Error.hi-boot [new file with mode: 0644]
ghc/lib/ghc/Error.lhs [new file with mode: 0644]
ghc/lib/ghc/GHC.hi-boot
ghc/lib/ghc/GHCerr.lhs
ghc/lib/ghc/GHCmain.lhs
ghc/lib/ghc/IOBase.lhs
ghc/lib/ghc/IOHandle.lhs
ghc/lib/ghc/PackBase.lhs
ghc/lib/ghc/PrelBase.lhs
ghc/lib/ghc/PrelList.lhs
ghc/lib/ghc/PrelNum.lhs
ghc/lib/ghc/PrelRead.lhs
ghc/lib/ghc/PrelTup.lhs
ghc/lib/ghc/STBase.lhs
ghc/lib/ghc/Unsafe.lhs [new file with mode: 0644]
ghc/lib/ghc/UnsafeST.lhs [deleted file]
ghc/lib/glaExts/Addr.lhs [new file with mode: 0644]
ghc/lib/glaExts/Bits.lhs [new file with mode: 0644]
ghc/lib/glaExts/ByteArray.lhs
ghc/lib/glaExts/CCall.lhs [new file with mode: 0644]
ghc/lib/glaExts/Foreign.lhs
ghc/lib/glaExts/GlaExts.lhs
ghc/lib/glaExts/IOExts.lhs [new file with mode: 0644]
ghc/lib/glaExts/IORef.lhs [new file with mode: 0644]
ghc/lib/glaExts/Int.lhs [new file with mode: 0644]
ghc/lib/glaExts/LazyST.lhs [new file with mode: 0644]
ghc/lib/glaExts/MutVar.lhs [deleted file]
ghc/lib/glaExts/ST.lhs
ghc/lib/glaExts/Word.lhs [new file with mode: 0644]
ghc/lib/required/CPUTime.lhs
ghc/lib/required/Char.lhs
ghc/lib/required/Directory.lhs
ghc/lib/required/IO.lhs
ghc/lib/required/Ix.lhs
ghc/lib/required/Maybe.lhs
ghc/lib/required/Prelude.lhs
ghc/lib/required/System.lhs
ghc/lib/required/Time.lhs
ghc/runtime/main/TopClosure.lc

index 9af0540..5996369 100644 (file)
 # DO NOT DELETE: Beginning of Haskell dependencies
-ghc/ArrBase.o : ghc/ArrBase.lhs
-ghc/ArrBase.mc.o : ghc/ArrBase.lhs
-ghc/ArrBase.norm.o : ghc/ArrBase.lhs
-ghc/ArrBase.p.o : ghc/ArrBase.lhs
-ghc/ArrBase.mc.o : ghc/IOBase.mc.hi
-ghc/ArrBase.norm.o : ghc/IOBase.norm.hi
-ghc/ArrBase.p.o : ghc/IOBase.p.hi
+ghc/ArrBase.o ghc/ArrBase.mc_o ghc/ArrBase.p_o ghc/ArrBase.t_o : ghc/ArrBase.lhs
+ghc/ArrBase.o ghc/ArrBase.mc_o ghc/ArrBase.p_o ghc/ArrBase.t_o : ghc/Error.hi-boot
 ghc/ArrBase.o : required/Ix.hi
-ghc/ArrBase.mc.o : required/Ix.mc.hi
-ghc/ArrBase.norm.o : required/Ix.norm.hi
-ghc/ArrBase.p.o : required/Ix.p.hi
+ghc/ArrBase.mc_o : required/Ix.mc_hi
+ghc/ArrBase.p_o : required/Ix.p_hi
+ghc/ArrBase.t_o : required/Ix.t_hi
 ghc/ArrBase.o : ghc/PrelList.hi
-ghc/ArrBase.mc.o : ghc/PrelList.mc.hi
-ghc/ArrBase.norm.o : ghc/PrelList.norm.hi
-ghc/ArrBase.p.o : ghc/PrelList.p.hi
-ghc/ArrBase.o : ghc/PrelNum.hi
-ghc/ArrBase.mc.o : ghc/PrelNum.mc.hi
-ghc/ArrBase.norm.o : ghc/PrelNum.norm.hi
-ghc/ArrBase.p.o : ghc/PrelNum.p.hi
+ghc/ArrBase.mc_o : ghc/PrelList.mc_hi
+ghc/ArrBase.p_o : ghc/PrelList.p_hi
+ghc/ArrBase.t_o : ghc/PrelList.t_hi
 ghc/ArrBase.o : ghc/STBase.hi
-ghc/ArrBase.mc.o : ghc/STBase.mc.hi
-ghc/ArrBase.norm.o : ghc/STBase.norm.hi
-ghc/ArrBase.p.o : ghc/STBase.p.hi
+ghc/ArrBase.mc_o : ghc/STBase.mc_hi
+ghc/ArrBase.p_o : ghc/STBase.p_hi
+ghc/ArrBase.t_o : ghc/STBase.t_hi
 ghc/ArrBase.o : ghc/PrelBase.hi
-ghc/ArrBase.mc.o : ghc/PrelBase.mc.hi
-ghc/ArrBase.norm.o : ghc/PrelBase.norm.hi
-ghc/ArrBase.p.o : ghc/PrelBase.p.hi
-ghc/ArrBase.o : ghc/PrelTup.hi
-ghc/ArrBase.mc.o : ghc/PrelTup.mc.hi
-ghc/ArrBase.norm.o : ghc/PrelTup.norm.hi
-ghc/ArrBase.p.o : ghc/PrelTup.p.hi
+ghc/ArrBase.mc_o : ghc/PrelBase.mc_hi
+ghc/ArrBase.p_o : ghc/PrelBase.p_hi
+ghc/ArrBase.t_o : ghc/PrelBase.t_hi
+ghc/ArrBase.o : glaExts/CCall.hi
+ghc/ArrBase.mc_o : glaExts/CCall.mc_hi
+ghc/ArrBase.p_o : glaExts/CCall.p_hi
+ghc/ArrBase.t_o : glaExts/CCall.t_hi
+ghc/ArrBase.o : glaExts/Addr.hi
+ghc/ArrBase.mc_o : glaExts/Addr.mc_hi
+ghc/ArrBase.p_o : glaExts/Addr.p_hi
+ghc/ArrBase.t_o : glaExts/Addr.t_hi
 ghc/ArrBase.o : ghc/GHC.hi
-ghc/ArrBase.mc.o : ghc/GHC.mc.hi
-ghc/ArrBase.norm.o : ghc/GHC.norm.hi
-ghc/ArrBase.p.o : ghc/GHC.p.hi
-ghc/ConcBase.o : ghc/ConcBase.lhs
-ghc/ConcBase.mc.o : ghc/ConcBase.lhs
-ghc/ConcBase.norm.o : ghc/ConcBase.lhs
-ghc/ConcBase.p.o : ghc/ConcBase.lhs
-ghc/ConcBase.o : required/Prelude.hi
+ghc/ArrBase.mc_o : ghc/GHC.mc_hi
+ghc/ArrBase.p_o : ghc/GHC.p_hi
+ghc/ArrBase.t_o : ghc/GHC.t_hi
+ghc/ConcBase.o ghc/ConcBase.mc_o ghc/ConcBase.p_o ghc/ConcBase.t_o : ghc/ConcBase.lhs
+ghc/ConcBase.o : ghc/PrelBase.hi
+ghc/ConcBase.mc_o : ghc/PrelBase.mc_hi
+ghc/ConcBase.p_o : ghc/PrelBase.p_hi
+ghc/ConcBase.t_o : ghc/PrelBase.t_hi
 ghc/ConcBase.o : ghc/STBase.hi
+ghc/ConcBase.mc_o : ghc/STBase.mc_hi
+ghc/ConcBase.p_o : ghc/STBase.p_hi
+ghc/ConcBase.t_o : ghc/STBase.t_hi
+ghc/ConcBase.o : ghc/IOBase.hi
+ghc/ConcBase.mc_o : ghc/IOBase.mc_hi
+ghc/ConcBase.p_o : ghc/IOBase.p_hi
+ghc/ConcBase.t_o : ghc/IOBase.t_hi
 ghc/ConcBase.o : ghc/GHCerr.hi
-ghc/ConcBase.mc.o : ghc/STBase.mc.hi
-ghc/ConcBase.norm.o : ghc/STBase.norm.hi
-ghc/ConcBase.p.o : ghc/STBase.p.hi
-ghc/GHCerr.o : ghc/GHCerr.lhs
-ghc/GHCerr.mc.o : ghc/GHCerr.lhs
-ghc/GHCerr.norm.o : ghc/GHCerr.lhs
-ghc/GHCerr.p.o : ghc/GHCerr.lhs
-ghc/GHCerr.o : ghc/IOBase.hi
-ghc/GHCerr.mc.o : ghc/IOBase.mc.hi
-ghc/GHCerr.norm.o : ghc/IOBase.norm.hi
-ghc/GHCerr.p.o : ghc/IOBase.p.hi
-ghc/GHCmain.o : ghc/GHCmain.lhs
-ghc/GHCmain.mc.o : ghc/GHCmain.lhs
-ghc/GHCmain.norm.o : ghc/GHCmain.lhs
-ghc/GHCmain.p.o : ghc/GHCmain.lhs
-ghc/GHCmain.mc.o : required/Prelude.mc.hi
-ghc/GHCmain.norm.o : required/Prelude.norm.hi
-ghc/GHCmain.p.o : required/Prelude.p.hi
-ghc/GHCmain.o : ghc/IOBase.hi
-ghc/GHCmain.mc.o : ghc/IOBase.mc.hi
-ghc/GHCmain.norm.o : ghc/IOBase.norm.hi
-ghc/GHCmain.p.o : ghc/IOBase.p.hi
-ghc/GHCmain.o : ghc/STBase.hi
-ghc/GHCmain.mc.o : ghc/STBase.mc.hi
-ghc/GHCmain.norm.o : ghc/STBase.norm.hi
-ghc/GHCmain.p.o : ghc/STBase.p.hi
-ghc/IOBase.o : ghc/IOBase.lhs
-ghc/IOBase.mc.o : ghc/IOBase.lhs
-ghc/IOBase.norm.o : ghc/IOBase.lhs
-ghc/IOBase.p.o : ghc/IOBase.lhs
-ghc/IOBase.o : ../../ghc/includes/error.h
-ghc/IOBase.mc.o : ../../ghc/includes/error.h
-ghc/IOBase.norm.o : ../../ghc/includes/error.h
-ghc/IOBase.p.o : ../../ghc/includes/error.h
-ghc/IOBase.mc.o : required/Prelude.mc.hi
-ghc/IOBase.norm.o : required/Prelude.norm.hi
-ghc/IOBase.p.o : required/Prelude.p.hi
+ghc/ConcBase.mc_o : ghc/GHCerr.mc_hi
+ghc/ConcBase.p_o : ghc/GHCerr.p_hi
+ghc/ConcBase.t_o : ghc/GHCerr.t_hi
+ghc/ConcBase.o : ghc/PrelBase.hi
+ghc/ConcBase.mc_o : ghc/PrelBase.mc_hi
+ghc/ConcBase.p_o : ghc/PrelBase.p_hi
+ghc/ConcBase.t_o : ghc/PrelBase.t_hi
+ghc/ConcBase.o : ghc/GHC.hi
+ghc/ConcBase.mc_o : ghc/GHC.mc_hi
+ghc/ConcBase.p_o : ghc/GHC.p_hi
+ghc/ConcBase.t_o : ghc/GHC.t_hi
+ghc/Error.o ghc/Error.mc_o ghc/Error.p_o ghc/Error.t_o : ghc/Error.lhs
+ghc/Error.o : ghc/PrelBase.hi
+ghc/Error.mc_o : ghc/PrelBase.mc_hi
+ghc/Error.p_o : ghc/PrelBase.p_hi
+ghc/Error.t_o : ghc/PrelBase.t_hi
+ghc/Error.o : ghc/IOBase.hi
+ghc/Error.mc_o : ghc/IOBase.mc_hi
+ghc/Error.p_o : ghc/IOBase.p_hi
+ghc/Error.t_o : ghc/IOBase.t_hi
+ghc/Error.o : glaExts/Foreign.hi
+ghc/Error.mc_o : glaExts/Foreign.mc_hi
+ghc/Error.p_o : glaExts/Foreign.p_hi
+ghc/Error.t_o : glaExts/Foreign.t_hi
+ghc/Error.o : glaExts/Addr.hi
+ghc/Error.mc_o : glaExts/Addr.mc_hi
+ghc/Error.p_o : glaExts/Addr.p_hi
+ghc/Error.t_o : glaExts/Addr.t_hi
+ghc/GHCerr.o ghc/GHCerr.mc_o ghc/GHCerr.p_o ghc/GHCerr.t_o : ghc/GHCerr.lhs
+ghc/GHCerr.o : ghc/PrelBase.hi
+ghc/GHCerr.mc_o : ghc/PrelBase.mc_hi
+ghc/GHCerr.p_o : ghc/PrelBase.p_hi
+ghc/GHCerr.t_o : ghc/PrelBase.t_hi
+ghc/GHCerr.o : ghc/PrelList.hi
+ghc/GHCerr.mc_o : ghc/PrelList.mc_hi
+ghc/GHCerr.p_o : ghc/PrelList.p_hi
+ghc/GHCerr.t_o : ghc/PrelList.t_hi
+ghc/GHCerr.o : ghc/Error.hi
+ghc/GHCerr.mc_o : ghc/Error.mc_hi
+ghc/GHCerr.p_o : ghc/Error.p_hi
+ghc/GHCerr.t_o : ghc/Error.t_hi
+ghc/GHCmain.o ghc/GHCmain.mc_o ghc/GHCmain.p_o ghc/GHCmain.t_o : ghc/GHCmain.lhs
+ghc/GHCmain.o : required/Prelude.hi
+ghc/GHCmain.mc_o : required/Prelude.mc_hi
+ghc/GHCmain.p_o : required/Prelude.p_hi
+ghc/GHCmain.t_o : required/Prelude.t_hi
+ghc/GHCmain.o ghc/GHCmain.mc_o ghc/GHCmain.p_o ghc/GHCmain.t_o : ghc/Main.hi-boot
+ghc/IOBase.o ghc/IOBase.mc_o ghc/IOBase.p_o ghc/IOBase.t_o : ghc/IOBase.lhs
+ghc/IOBase.o ghc/IOBase.mc_o ghc/IOBase.p_o ghc/IOBase.t_o : ghc/Error.hi-boot
 ghc/IOBase.o : ghc/STBase.hi
-ghc/IOBase.mc.o : ghc/STBase.mc.hi
-ghc/IOBase.norm.o : ghc/STBase.norm.hi
-ghc/IOBase.p.o : ghc/STBase.p.hi
+ghc/IOBase.mc_o : ghc/STBase.mc_hi
+ghc/IOBase.p_o : ghc/STBase.p_hi
+ghc/IOBase.t_o : ghc/STBase.t_hi
 ghc/IOBase.o : ghc/PrelTup.hi
-ghc/IOBase.mc.o : ghc/PrelTup.mc.hi
-ghc/IOBase.norm.o : ghc/PrelTup.norm.hi
-ghc/IOBase.p.o : ghc/PrelTup.p.hi
-ghc/IOBase.o : glaExts/Foreign.hi
-ghc/IOBase.mc.o : glaExts/Foreign.mc.hi
-ghc/IOBase.norm.o : glaExts/Foreign.norm.hi
-ghc/IOBase.p.o : glaExts/Foreign.p.hi
-ghc/IOBase.o : glaExts/PackedString.hi
-ghc/IOBase.mc.o : glaExts/PackedString.mc.hi
-ghc/IOBase.norm.o : glaExts/PackedString.norm.hi
-ghc/IOBase.p.o : glaExts/PackedString.p.hi
+ghc/IOBase.mc_o : ghc/PrelTup.mc_hi
+ghc/IOBase.p_o : ghc/PrelTup.p_hi
+ghc/IOBase.t_o : ghc/PrelTup.t_hi
+ghc/IOBase.o : glaExts/Addr.hi
+ghc/IOBase.mc_o : glaExts/Addr.mc_hi
+ghc/IOBase.p_o : glaExts/Addr.p_hi
+ghc/IOBase.t_o : glaExts/Addr.t_hi
+ghc/IOBase.o : ghc/PackBase.hi
+ghc/IOBase.mc_o : ghc/PackBase.mc_hi
+ghc/IOBase.p_o : ghc/PackBase.p_hi
+ghc/IOBase.t_o : ghc/PackBase.t_hi
 ghc/IOBase.o : ghc/PrelBase.hi
-ghc/IOBase.mc.o : ghc/PrelBase.mc.hi
-ghc/IOBase.norm.o : ghc/PrelBase.norm.hi
-ghc/IOBase.p.o : ghc/PrelBase.p.hi
+ghc/IOBase.mc_o : ghc/PrelBase.mc_hi
+ghc/IOBase.p_o : ghc/PrelBase.p_hi
+ghc/IOBase.t_o : ghc/PrelBase.t_hi
+ghc/IOBase.o : ghc/ArrBase.hi
+ghc/IOBase.mc_o : ghc/ArrBase.mc_hi
+ghc/IOBase.p_o : ghc/ArrBase.p_hi
+ghc/IOBase.t_o : ghc/ArrBase.t_hi
 ghc/IOBase.o : ghc/GHC.hi
-ghc/IOBase.mc.o : ghc/GHC.mc.hi
-ghc/IOBase.norm.o : ghc/GHC.norm.hi
-ghc/IOBase.p.o : ghc/GHC.p.hi
-ghc/IOHandle.o : ghc/IOHandle.lhs
-ghc/IOHandle.mc.o : ghc/IOHandle.lhs
-ghc/IOHandle.norm.o : ghc/IOHandle.lhs
-ghc/IOHandle.p.o : ghc/IOHandle.lhs
-ghc/IOHandle.o : ../../ghc/includes/error.h
-ghc/IOHandle.mc.o : ../../ghc/includes/error.h
-ghc/IOHandle.norm.o : ../../ghc/includes/error.h
-ghc/IOHandle.p.o : ../../ghc/includes/error.h
-ghc/IOHandle.mc.o : required/Prelude.mc.hi
-ghc/IOHandle.norm.o : required/Prelude.norm.hi
-ghc/IOHandle.p.o : required/Prelude.p.hi
+ghc/IOBase.mc_o : ghc/GHC.mc_hi
+ghc/IOBase.p_o : ghc/GHC.p_hi
+ghc/IOBase.t_o : ghc/GHC.t_hi
+ghc/IOHandle.o ghc/IOHandle.mc_o ghc/IOHandle.p_o ghc/IOHandle.t_o : ghc/IOHandle.lhs
 ghc/IOHandle.o : glaExts/ST.hi
-ghc/IOHandle.mc.o : glaExts/ST.mc.hi
-ghc/IOHandle.norm.o : glaExts/ST.norm.hi
-ghc/IOHandle.p.o : glaExts/ST.p.hi
+ghc/IOHandle.mc_o : glaExts/ST.mc_hi
+ghc/IOHandle.p_o : glaExts/ST.p_hi
+ghc/IOHandle.t_o : glaExts/ST.t_hi
 ghc/IOHandle.o : ghc/STBase.hi
-ghc/IOHandle.mc.o : ghc/STBase.mc.hi
-ghc/IOHandle.norm.o : ghc/STBase.norm.hi
-ghc/IOHandle.p.o : ghc/STBase.p.hi
+ghc/IOHandle.mc_o : ghc/STBase.mc_hi
+ghc/IOHandle.p_o : ghc/STBase.p_hi
+ghc/IOHandle.t_o : ghc/STBase.t_hi
 ghc/IOHandle.o : ghc/ArrBase.hi
-ghc/IOHandle.mc.o : ghc/ArrBase.mc.hi
-ghc/IOHandle.norm.o : ghc/ArrBase.norm.hi
-ghc/IOHandle.p.o : ghc/ArrBase.p.hi
+ghc/IOHandle.mc_o : ghc/ArrBase.mc_hi
+ghc/IOHandle.p_o : ghc/ArrBase.p_hi
+ghc/IOHandle.t_o : ghc/ArrBase.t_hi
 ghc/IOHandle.o : ghc/PrelRead.hi
-ghc/IOHandle.mc.o : ghc/PrelRead.mc.hi
-ghc/IOHandle.norm.o : ghc/PrelRead.norm.hi
-ghc/IOHandle.p.o : ghc/PrelRead.p.hi
+ghc/IOHandle.mc_o : ghc/PrelRead.mc_hi
+ghc/IOHandle.p_o : ghc/PrelRead.p_hi
+ghc/IOHandle.t_o : ghc/PrelRead.t_hi
+ghc/IOHandle.o : ghc/PrelList.hi
+ghc/IOHandle.mc_o : ghc/PrelList.mc_hi
+ghc/IOHandle.p_o : ghc/PrelList.p_hi
+ghc/IOHandle.t_o : ghc/PrelList.t_hi
 ghc/IOHandle.o : required/Ix.hi
-ghc/IOHandle.mc.o : required/Ix.mc.hi
-ghc/IOHandle.norm.o : required/Ix.norm.hi
-ghc/IOHandle.p.o : required/Ix.p.hi
+ghc/IOHandle.mc_o : required/Ix.mc_hi
+ghc/IOHandle.p_o : required/Ix.p_hi
+ghc/IOHandle.t_o : required/Ix.t_hi
 ghc/IOHandle.o : ghc/IOBase.hi
-ghc/IOHandle.mc.o : ghc/IOBase.mc.hi
-ghc/IOHandle.norm.o : ghc/IOBase.norm.hi
-ghc/IOHandle.p.o : ghc/IOBase.p.hi
+ghc/IOHandle.mc_o : ghc/IOBase.mc_hi
+ghc/IOHandle.p_o : ghc/IOBase.p_hi
+ghc/IOHandle.t_o : ghc/IOBase.t_hi
+ghc/IOHandle.o : ghc/Unsafe.hi
+ghc/IOHandle.mc_o : ghc/Unsafe.mc_hi
+ghc/IOHandle.p_o : ghc/Unsafe.p_hi
+ghc/IOHandle.t_o : ghc/Unsafe.t_hi
 ghc/IOHandle.o : ghc/PrelTup.hi
-ghc/IOHandle.mc.o : ghc/PrelTup.mc.hi
-ghc/IOHandle.norm.o : ghc/PrelTup.norm.hi
-ghc/IOHandle.p.o : ghc/PrelTup.p.hi
+ghc/IOHandle.mc_o : ghc/PrelTup.mc_hi
+ghc/IOHandle.p_o : ghc/PrelTup.p_hi
+ghc/IOHandle.t_o : ghc/PrelTup.t_hi
 ghc/IOHandle.o : ghc/PrelBase.hi
-ghc/IOHandle.mc.o : ghc/PrelBase.mc.hi
-ghc/IOHandle.norm.o : ghc/PrelBase.norm.hi
-ghc/IOHandle.p.o : ghc/PrelBase.p.hi
+ghc/IOHandle.mc_o : ghc/PrelBase.mc_hi
+ghc/IOHandle.p_o : ghc/PrelBase.p_hi
+ghc/IOHandle.t_o : ghc/PrelBase.t_hi
 ghc/IOHandle.o : ghc/GHC.hi
-ghc/IOHandle.mc.o : ghc/GHC.mc.hi
-ghc/IOHandle.norm.o : ghc/GHC.norm.hi
-ghc/IOHandle.p.o : ghc/GHC.p.hi
-ghc/PrelBase.o : ghc/PrelBase.lhs
-ghc/PrelBase.mc.o : ghc/PrelBase.lhs
-ghc/PrelBase.norm.o : ghc/PrelBase.lhs
-ghc/PrelBase.p.o : ghc/PrelBase.lhs
-ghc/PrelBase.mc.o : required/Prelude.mc.hi
-ghc/PrelBase.norm.o : required/Prelude.norm.hi
-ghc/PrelBase.p.o : required/Prelude.p.hi
-ghc/PrelBase.mc.o : ghc/IOBase.mc.hi
-ghc/PrelBase.norm.o : ghc/IOBase.norm.hi
-ghc/PrelBase.p.o : ghc/IOBase.p.hi
+ghc/IOHandle.mc_o : ghc/GHC.mc_hi
+ghc/IOHandle.p_o : ghc/GHC.p_hi
+ghc/IOHandle.t_o : ghc/GHC.t_hi
+ghc/IOHandle.o : glaExts/Addr.hi
+ghc/IOHandle.mc_o : glaExts/Addr.mc_hi
+ghc/IOHandle.p_o : glaExts/Addr.p_hi
+ghc/IOHandle.t_o : glaExts/Addr.t_hi
+ghc/IOHandle.o : ghc/Error.hi
+ghc/IOHandle.mc_o : ghc/Error.mc_hi
+ghc/IOHandle.p_o : ghc/Error.p_hi
+ghc/IOHandle.t_o : ghc/Error.t_hi
+ghc/IOHandle.o : glaExts/Foreign.hi
+ghc/IOHandle.mc_o : glaExts/Foreign.mc_hi
+ghc/IOHandle.p_o : glaExts/Foreign.p_hi
+ghc/IOHandle.t_o : glaExts/Foreign.t_hi
+ghc/IOMonad.o ghc/IOMonad.mc_o ghc/IOMonad.p_o ghc/IOMonad.t_o : ghc/IOMonad.lhs
+ghc/IORef.o ghc/IORef.mc_o ghc/IORef.p_o ghc/IORef.t_o : ghc/IORef.lhs
+ghc/IORef.o : ghc/PrelBase.hi
+ghc/IORef.mc_o : ghc/PrelBase.mc_hi
+ghc/IORef.p_o : ghc/PrelBase.p_hi
+ghc/IORef.t_o : ghc/PrelBase.t_hi
+ghc/IORef.o : ghc/ArrBase.hi
+ghc/IORef.mc_o : ghc/ArrBase.mc_hi
+ghc/IORef.p_o : ghc/ArrBase.p_hi
+ghc/IORef.t_o : ghc/ArrBase.t_hi
+ghc/IORef.o : ghc/IOBase.hi
+ghc/IORef.mc_o : ghc/IOBase.mc_hi
+ghc/IORef.p_o : ghc/IOBase.p_hi
+ghc/IORef.t_o : ghc/IOBase.t_hi
+ghc/IORef.o : ghc/STBase.hi
+ghc/IORef.mc_o : ghc/STBase.mc_hi
+ghc/IORef.p_o : ghc/STBase.p_hi
+ghc/IORef.t_o : ghc/STBase.t_hi
+ghc/PackBase.o ghc/PackBase.mc_o ghc/PackBase.p_o ghc/PackBase.t_o : ghc/PackBase.lhs
+ghc/PackBase.o : ghc/PrelBase.hi
+ghc/PackBase.mc_o : ghc/PrelBase.mc_hi
+ghc/PackBase.p_o : ghc/PrelBase.p_hi
+ghc/PackBase.t_o : ghc/PrelBase.t_hi
+ghc/PackBase.o ghc/PackBase.mc_o ghc/PackBase.p_o ghc/PackBase.t_o : ghc/Error.hi-boot
+ghc/PackBase.o : ghc/PrelList.hi
+ghc/PackBase.mc_o : ghc/PrelList.mc_hi
+ghc/PackBase.p_o : ghc/PrelList.p_hi
+ghc/PackBase.t_o : ghc/PrelList.t_hi
+ghc/PackBase.o : ghc/STBase.hi
+ghc/PackBase.mc_o : ghc/STBase.mc_hi
+ghc/PackBase.p_o : ghc/STBase.p_hi
+ghc/PackBase.t_o : ghc/STBase.t_hi
+ghc/PackBase.o : ghc/ArrBase.hi
+ghc/PackBase.mc_o : ghc/ArrBase.mc_hi
+ghc/PackBase.p_o : ghc/ArrBase.p_hi
+ghc/PackBase.t_o : ghc/ArrBase.t_hi
+ghc/PackBase.o : glaExts/Addr.hi
+ghc/PackBase.mc_o : glaExts/Addr.mc_hi
+ghc/PackBase.p_o : glaExts/Addr.p_hi
+ghc/PackBase.t_o : glaExts/Addr.t_hi
+ghc/PrelBase.o ghc/PrelBase.mc_o ghc/PrelBase.p_o ghc/PrelBase.t_o : ghc/PrelBase.lhs
+ghc/PrelBase.o ghc/PrelBase.mc_o ghc/PrelBase.p_o ghc/PrelBase.t_o : ghc/Error.hi-boot
 ghc/PrelBase.o : ghc/GHC.hi
-ghc/PrelBase.mc.o : ghc/GHC.mc.hi
-ghc/PrelBase.norm.o : ghc/GHC.norm.hi
-ghc/PrelBase.p.o : ghc/GHC.p.hi
-ghc/PrelIO.o : ghc/PrelIO.lhs
-ghc/PrelIO.mc.o : ghc/PrelIO.lhs
-ghc/PrelIO.norm.o : ghc/PrelIO.lhs
-ghc/PrelIO.p.o : ghc/PrelIO.lhs
-ghc/PrelIO.mc.o : required/Prelude.mc.hi
-ghc/PrelIO.norm.o : required/Prelude.norm.hi
-ghc/PrelIO.p.o : required/Prelude.p.hi
+ghc/PrelBase.mc_o : ghc/GHC.mc_hi
+ghc/PrelBase.p_o : ghc/GHC.p_hi
+ghc/PrelBase.t_o : ghc/GHC.t_hi
+ghc/PrelIO.o ghc/PrelIO.mc_o ghc/PrelIO.p_o ghc/PrelIO.t_o : ghc/PrelIO.lhs
 ghc/PrelIO.o : required/IO.hi
-ghc/PrelIO.mc.o : required/IO.mc.hi
-ghc/PrelIO.norm.o : required/IO.norm.hi
-ghc/PrelIO.p.o : required/IO.p.hi
+ghc/PrelIO.mc_o : required/IO.mc_hi
+ghc/PrelIO.p_o : required/IO.p_hi
+ghc/PrelIO.t_o : required/IO.t_hi
 ghc/PrelIO.o : ghc/IOHandle.hi
-ghc/PrelIO.mc.o : ghc/IOHandle.mc.hi
-ghc/PrelIO.norm.o : ghc/IOHandle.norm.hi
-ghc/PrelIO.p.o : ghc/IOHandle.p.hi
+ghc/PrelIO.mc_o : ghc/IOHandle.mc_hi
+ghc/PrelIO.p_o : ghc/IOHandle.p_hi
+ghc/PrelIO.t_o : ghc/IOHandle.t_hi
 ghc/PrelIO.o : ghc/IOBase.hi
-ghc/PrelIO.mc.o : ghc/IOBase.mc.hi
-ghc/PrelIO.norm.o : ghc/IOBase.norm.hi
-ghc/PrelIO.p.o : ghc/IOBase.p.hi
+ghc/PrelIO.mc_o : ghc/IOBase.mc_hi
+ghc/PrelIO.p_o : ghc/IOBase.p_hi
+ghc/PrelIO.t_o : ghc/IOBase.t_hi
 ghc/PrelIO.o : ghc/PrelBase.hi
-ghc/PrelIO.mc.o : ghc/PrelBase.mc.hi
-ghc/PrelIO.norm.o : ghc/PrelBase.norm.hi
-ghc/PrelIO.p.o : ghc/PrelBase.p.hi
+ghc/PrelIO.mc_o : ghc/PrelBase.mc_hi
+ghc/PrelIO.p_o : ghc/PrelBase.p_hi
+ghc/PrelIO.t_o : ghc/PrelBase.t_hi
 ghc/PrelIO.o : ghc/PrelRead.hi
-ghc/PrelIO.mc.o : ghc/PrelRead.mc.hi
-ghc/PrelIO.norm.o : ghc/PrelRead.norm.hi
-ghc/PrelIO.p.o : ghc/PrelRead.p.hi
-ghc/PrelList.o : ghc/PrelList.lhs
-ghc/PrelList.mc.o : ghc/PrelList.lhs
-ghc/PrelList.norm.o : ghc/PrelList.lhs
-ghc/PrelList.p.o : ghc/PrelList.lhs
-ghc/PrelList.mc.o : required/Prelude.mc.hi
-ghc/PrelList.norm.o : required/Prelude.norm.hi
-ghc/PrelList.p.o : required/Prelude.p.hi
-ghc/PrelList.mc.o : ghc/IOBase.mc.hi
-ghc/PrelList.norm.o : ghc/IOBase.norm.hi
-ghc/PrelList.p.o : ghc/IOBase.p.hi
+ghc/PrelIO.mc_o : ghc/PrelRead.mc_hi
+ghc/PrelIO.p_o : ghc/PrelRead.p_hi
+ghc/PrelIO.t_o : ghc/PrelRead.t_hi
+ghc/PrelList.o ghc/PrelList.mc_o ghc/PrelList.p_o ghc/PrelList.t_o : ghc/PrelList.lhs
+ghc/PrelList.o ghc/PrelList.mc_o ghc/PrelList.p_o ghc/PrelList.t_o : ghc/Error.hi-boot
 ghc/PrelList.o : ghc/PrelTup.hi
-ghc/PrelList.mc.o : ghc/PrelTup.mc.hi
-ghc/PrelList.norm.o : ghc/PrelTup.norm.hi
-ghc/PrelList.p.o : ghc/PrelTup.p.hi
+ghc/PrelList.mc_o : ghc/PrelTup.mc_hi
+ghc/PrelList.p_o : ghc/PrelTup.p_hi
+ghc/PrelList.t_o : ghc/PrelTup.t_hi
 ghc/PrelList.o : ghc/PrelBase.hi
-ghc/PrelList.mc.o : ghc/PrelBase.mc.hi
-ghc/PrelList.norm.o : ghc/PrelBase.norm.hi
-ghc/PrelList.p.o : ghc/PrelBase.p.hi
-ghc/PrelNum.o : ghc/PrelNum.lhs
-ghc/PrelNum.mc.o : ghc/PrelNum.lhs
-ghc/PrelNum.norm.o : ghc/PrelNum.lhs
-ghc/PrelNum.p.o : ghc/PrelNum.lhs
-ghc/PrelNum.o : ./../includes/ieee-flpt.h
-ghc/PrelNum.mc.o : ./../includes/ieee-flpt.h
-ghc/PrelNum.norm.o : ./../includes/ieee-flpt.h
-ghc/PrelNum.p.o : ./../includes/ieee-flpt.h
-ghc/PrelNum.mc.o : required/Prelude.mc.hi
-ghc/PrelNum.norm.o : required/Prelude.norm.hi
-ghc/PrelNum.p.o : required/Prelude.p.hi
-ghc/PrelNum.mc.o : ghc/IOBase.mc.hi
-ghc/PrelNum.norm.o : ghc/IOBase.norm.hi
-ghc/PrelNum.p.o : ghc/IOBase.p.hi
-ghc/PrelNum.o : ghc/PrelList.hi
-ghc/PrelNum.mc.o : ghc/PrelList.mc.hi
-ghc/PrelNum.norm.o : ghc/PrelList.norm.hi
-ghc/PrelNum.p.o : ghc/PrelList.p.hi
+ghc/PrelList.mc_o : ghc/PrelBase.mc_hi
+ghc/PrelList.p_o : ghc/PrelBase.p_hi
+ghc/PrelList.t_o : ghc/PrelBase.t_hi
+ghc/PrelNum.o ghc/PrelNum.mc_o ghc/PrelNum.p_o ghc/PrelNum.t_o : ghc/PrelNum.lhs
 ghc/PrelNum.o : ghc/PrelBase.hi
-ghc/PrelNum.mc.o : ghc/PrelBase.mc.hi
-ghc/PrelNum.norm.o : ghc/PrelBase.norm.hi
-ghc/PrelNum.p.o : ghc/PrelBase.p.hi
+ghc/PrelNum.mc_o : ghc/PrelBase.mc_hi
+ghc/PrelNum.p_o : ghc/PrelBase.p_hi
+ghc/PrelNum.t_o : ghc/PrelBase.t_hi
 ghc/PrelNum.o : ghc/GHC.hi
-ghc/PrelNum.mc.o : ghc/GHC.mc.hi
-ghc/PrelNum.norm.o : ghc/GHC.norm.hi
-ghc/PrelNum.p.o : ghc/GHC.p.hi
-ghc/PrelRead.o : ghc/PrelRead.lhs
-ghc/PrelRead.mc.o : ghc/PrelRead.lhs
-ghc/PrelRead.norm.o : ghc/PrelRead.lhs
-ghc/PrelRead.p.o : ghc/PrelRead.lhs
-ghc/PrelRead.mc.o : required/Prelude.mc.hi
-ghc/PrelRead.norm.o : required/Prelude.norm.hi
-ghc/PrelRead.p.o : required/Prelude.p.hi
-ghc/PrelRead.mc.o : ghc/IOBase.mc.hi
-ghc/PrelRead.norm.o : ghc/IOBase.norm.hi
-ghc/PrelRead.p.o : ghc/IOBase.p.hi
+ghc/PrelNum.mc_o : ghc/GHC.mc_hi
+ghc/PrelNum.p_o : ghc/GHC.p_hi
+ghc/PrelNum.t_o : ghc/GHC.t_hi
+ghc/PrelNum.o ghc/PrelNum.mc_o ghc/PrelNum.p_o ghc/PrelNum.t_o : ghc/Error.hi-boot
+ghc/PrelNum.o : ghc/PrelList.hi
+ghc/PrelNum.mc_o : ghc/PrelList.mc_hi
+ghc/PrelNum.p_o : ghc/PrelList.p_hi
+ghc/PrelNum.t_o : ghc/PrelList.t_hi
+ghc/PrelNum.o : ghc/ArrBase.hi
+ghc/PrelNum.mc_o : ghc/ArrBase.mc_hi
+ghc/PrelNum.p_o : ghc/ArrBase.p_hi
+ghc/PrelNum.t_o : ghc/ArrBase.t_hi
+ghc/PrelNum.o : ghc/Unsafe.hi
+ghc/PrelNum.mc_o : ghc/Unsafe.mc_hi
+ghc/PrelNum.p_o : ghc/Unsafe.p_hi
+ghc/PrelNum.t_o : ghc/Unsafe.t_hi
+ghc/PrelNum.o : required/Ix.hi
+ghc/PrelNum.mc_o : required/Ix.mc_hi
+ghc/PrelNum.p_o : required/Ix.p_hi
+ghc/PrelNum.t_o : required/Ix.t_hi
+ghc/PrelNum.o : glaExts/CCall.hi
+ghc/PrelNum.mc_o : glaExts/CCall.mc_hi
+ghc/PrelNum.p_o : glaExts/CCall.p_hi
+ghc/PrelNum.t_o : glaExts/CCall.t_hi
+ghc/PrelRead.o ghc/PrelRead.mc_o ghc/PrelRead.p_o ghc/PrelRead.t_o : ghc/PrelRead.lhs
+ghc/PrelRead.o ghc/PrelRead.mc_o ghc/PrelRead.p_o ghc/PrelRead.t_o : ghc/Error.hi-boot
 ghc/PrelRead.o : ghc/PrelNum.hi
-ghc/PrelRead.mc.o : ghc/PrelNum.mc.hi
-ghc/PrelRead.norm.o : ghc/PrelNum.norm.hi
-ghc/PrelRead.p.o : ghc/PrelNum.p.hi
+ghc/PrelRead.mc_o : ghc/PrelNum.mc_hi
+ghc/PrelRead.p_o : ghc/PrelNum.p_hi
+ghc/PrelRead.t_o : ghc/PrelNum.t_hi
 ghc/PrelRead.o : ghc/PrelList.hi
-ghc/PrelRead.mc.o : ghc/PrelList.mc.hi
-ghc/PrelRead.norm.o : ghc/PrelList.norm.hi
-ghc/PrelRead.p.o : ghc/PrelList.p.hi
+ghc/PrelRead.mc_o : ghc/PrelList.mc_hi
+ghc/PrelRead.p_o : ghc/PrelList.p_hi
+ghc/PrelRead.t_o : ghc/PrelList.t_hi
 ghc/PrelRead.o : ghc/PrelTup.hi
-ghc/PrelRead.mc.o : ghc/PrelTup.mc.hi
-ghc/PrelRead.norm.o : ghc/PrelTup.norm.hi
-ghc/PrelRead.p.o : ghc/PrelTup.p.hi
+ghc/PrelRead.mc_o : ghc/PrelTup.mc_hi
+ghc/PrelRead.p_o : ghc/PrelTup.p_hi
+ghc/PrelRead.t_o : ghc/PrelTup.t_hi
 ghc/PrelRead.o : ghc/PrelBase.hi
-ghc/PrelRead.mc.o : ghc/PrelBase.mc.hi
-ghc/PrelRead.norm.o : ghc/PrelBase.norm.hi
-ghc/PrelRead.p.o : ghc/PrelBase.p.hi
-ghc/PrelTup.o : ghc/PrelTup.lhs
-ghc/PrelTup.mc.o : ghc/PrelTup.lhs
-ghc/PrelTup.norm.o : ghc/PrelTup.lhs
-ghc/PrelTup.p.o : ghc/PrelTup.lhs
-ghc/PrelTup.mc.o : required/Prelude.mc.hi
-ghc/PrelTup.norm.o : required/Prelude.norm.hi
-ghc/PrelTup.p.o : required/Prelude.p.hi
-ghc/PrelTup.mc.o : ghc/IOBase.mc.hi
-ghc/PrelTup.norm.o : ghc/IOBase.norm.hi
-ghc/PrelTup.p.o : ghc/IOBase.p.hi
+ghc/PrelRead.mc_o : ghc/PrelBase.mc_hi
+ghc/PrelRead.p_o : ghc/PrelBase.p_hi
+ghc/PrelRead.t_o : ghc/PrelBase.t_hi
+ghc/PrelTup.o ghc/PrelTup.mc_o ghc/PrelTup.p_o ghc/PrelTup.t_o : ghc/PrelTup.lhs
+ghc/PrelTup.o ghc/PrelTup.mc_o ghc/PrelTup.p_o ghc/PrelTup.t_o : ghc/Error.hi-boot
 ghc/PrelTup.o : ghc/PrelBase.hi
-ghc/PrelTup.mc.o : ghc/PrelBase.mc.hi
-ghc/PrelTup.norm.o : ghc/PrelBase.norm.hi
-ghc/PrelTup.p.o : ghc/PrelBase.p.hi
-ghc/STBase.o : ghc/STBase.lhs
-ghc/STBase.mc.o : ghc/STBase.lhs
-ghc/STBase.norm.o : ghc/STBase.lhs
-ghc/STBase.p.o : ghc/STBase.lhs
-ghc/STBase.mc.o : required/Prelude.mc.hi
-ghc/STBase.norm.o : required/Prelude.norm.hi
-ghc/STBase.p.o : required/Prelude.p.hi
-ghc/STBase.o : required/Ix.hi
-ghc/STBase.mc.o : required/Ix.mc.hi
-ghc/STBase.norm.o : required/Ix.norm.hi
-ghc/STBase.p.o : required/Ix.p.hi
+ghc/PrelTup.mc_o : ghc/PrelBase.mc_hi
+ghc/PrelTup.p_o : ghc/PrelBase.p_hi
+ghc/PrelTup.t_o : ghc/PrelBase.t_hi
+ghc/STBase.o ghc/STBase.mc_o ghc/STBase.p_o ghc/STBase.t_o : ghc/STBase.lhs
 ghc/STBase.o : required/Monad.hi
-ghc/STBase.mc.o : required/Monad.mc.hi
-ghc/STBase.norm.o : required/Monad.norm.hi
-ghc/STBase.p.o : required/Monad.p.hi
-ghc/STBase.o : ghc/PrelTup.hi
-ghc/STBase.mc.o : ghc/PrelTup.mc.hi
-ghc/STBase.norm.o : ghc/PrelTup.norm.hi
-ghc/STBase.p.o : ghc/PrelTup.p.hi
+ghc/STBase.mc_o : required/Monad.mc_hi
+ghc/STBase.p_o : required/Monad.p_hi
+ghc/STBase.t_o : required/Monad.t_hi
 ghc/STBase.o : ghc/PrelBase.hi
-ghc/STBase.mc.o : ghc/PrelBase.mc.hi
-ghc/STBase.norm.o : ghc/PrelBase.norm.hi
-ghc/STBase.p.o : ghc/PrelBase.p.hi
+ghc/STBase.mc_o : ghc/PrelBase.mc_hi
+ghc/STBase.p_o : ghc/PrelBase.p_hi
+ghc/STBase.t_o : ghc/PrelBase.t_hi
 ghc/STBase.o : ghc/GHC.hi
-ghc/STBase.mc.o : ghc/GHC.mc.hi
-ghc/STBase.norm.o : ghc/GHC.norm.hi
-ghc/STBase.p.o : ghc/GHC.p.hi
-required/Array.o : required/Array.lhs
-required/Array.mc.o : required/Array.lhs
-required/Array.norm.o : required/Array.lhs
-required/Array.p.o : required/Array.lhs
-required/Array.mc.o : required/Prelude.mc.hi
-required/Array.norm.o : required/Prelude.norm.hi
-required/Array.p.o : required/Prelude.p.hi
+ghc/STBase.mc_o : ghc/GHC.mc_hi
+ghc/STBase.p_o : ghc/GHC.p_hi
+ghc/STBase.t_o : ghc/GHC.t_hi
+ghc/Unsafe.o ghc/Unsafe.mc_o ghc/Unsafe.p_o ghc/Unsafe.t_o : ghc/Unsafe.lhs
+ghc/Unsafe.o : ghc/PrelBase.hi
+ghc/Unsafe.mc_o : ghc/PrelBase.mc_hi
+ghc/Unsafe.p_o : ghc/PrelBase.p_hi
+ghc/Unsafe.t_o : ghc/PrelBase.t_hi
+ghc/Unsafe.o : ghc/IOBase.hi
+ghc/Unsafe.mc_o : ghc/IOBase.mc_hi
+ghc/Unsafe.p_o : ghc/IOBase.p_hi
+ghc/Unsafe.t_o : ghc/IOBase.t_hi
+ghc/Unsafe.o : ghc/STBase.hi
+ghc/Unsafe.mc_o : ghc/STBase.mc_hi
+ghc/Unsafe.p_o : ghc/STBase.p_hi
+ghc/Unsafe.t_o : ghc/STBase.t_hi
+ghc/Unsafe.o : glaExts/Addr.hi
+ghc/Unsafe.mc_o : glaExts/Addr.mc_hi
+ghc/Unsafe.p_o : glaExts/Addr.p_hi
+ghc/Unsafe.t_o : glaExts/Addr.t_hi
+ghc/Unsafe.o ghc/Unsafe.mc_o ghc/Unsafe.p_o ghc/Unsafe.t_o : ghc/Error.hi-boot
+required/Array.o required/Array.mc_o required/Array.p_o required/Array.t_o : required/Array.lhs
 required/Array.o : required/Ix.hi
-required/Array.mc.o : required/Ix.mc.hi
-required/Array.norm.o : required/Ix.norm.hi
-required/Array.p.o : required/Ix.p.hi
+required/Array.mc_o : required/Ix.mc_hi
+required/Array.p_o : required/Ix.p_hi
+required/Array.t_o : required/Ix.t_hi
 required/Array.o : ghc/PrelList.hi
-required/Array.mc.o : ghc/PrelList.mc.hi
-required/Array.norm.o : ghc/PrelList.norm.hi
-required/Array.p.o : ghc/PrelList.p.hi
+required/Array.mc_o : ghc/PrelList.mc_hi
+required/Array.p_o : ghc/PrelList.p_hi
+required/Array.t_o : ghc/PrelList.t_hi
 required/Array.o : ghc/PrelRead.hi
-required/Array.mc.o : ghc/PrelRead.mc.hi
-required/Array.norm.o : ghc/PrelRead.norm.hi
-required/Array.p.o : ghc/PrelRead.p.hi
+required/Array.mc_o : ghc/PrelRead.mc_hi
+required/Array.p_o : ghc/PrelRead.p_hi
+required/Array.t_o : ghc/PrelRead.t_hi
 required/Array.o : ghc/ArrBase.hi
-required/Array.mc.o : ghc/ArrBase.mc.hi
-required/Array.norm.o : ghc/ArrBase.norm.hi
-required/Array.p.o : ghc/ArrBase.p.hi
+required/Array.mc_o : ghc/ArrBase.mc_hi
+required/Array.p_o : ghc/ArrBase.p_hi
+required/Array.t_o : ghc/ArrBase.t_hi
 required/Array.o : ghc/PrelBase.hi
-required/Array.mc.o : ghc/PrelBase.mc.hi
-required/Array.norm.o : ghc/PrelBase.norm.hi
-required/Array.p.o : ghc/PrelBase.p.hi
-required/Char.o : required/Char.lhs
-required/Char.mc.o : required/Char.lhs
-required/Char.norm.o : required/Char.lhs
-required/Char.p.o : required/Char.lhs
-required/Char.mc.o : required/Prelude.mc.hi
-required/Char.norm.o : required/Prelude.norm.hi
-required/Char.p.o : required/Prelude.p.hi
+required/Array.mc_o : ghc/PrelBase.mc_hi
+required/Array.p_o : ghc/PrelBase.p_hi
+required/Array.t_o : ghc/PrelBase.t_hi
+required/CPUTime.o required/CPUTime.mc_o required/CPUTime.p_o required/CPUTime.t_o : required/CPUTime.lhs
+required/CPUTime.o : ghc/PrelBase.hi
+required/CPUTime.mc_o : ghc/PrelBase.mc_hi
+required/CPUTime.p_o : ghc/PrelBase.p_hi
+required/CPUTime.t_o : ghc/PrelBase.t_hi
+required/CPUTime.o : ghc/ArrBase.hi
+required/CPUTime.mc_o : ghc/ArrBase.mc_hi
+required/CPUTime.p_o : ghc/ArrBase.p_hi
+required/CPUTime.t_o : ghc/ArrBase.t_hi
+required/CPUTime.o : glaExts/Addr.hi
+required/CPUTime.mc_o : glaExts/Addr.mc_hi
+required/CPUTime.p_o : glaExts/Addr.p_hi
+required/CPUTime.t_o : glaExts/Addr.t_hi
+required/CPUTime.o : ghc/IOBase.hi
+required/CPUTime.mc_o : ghc/IOBase.mc_hi
+required/CPUTime.p_o : ghc/IOBase.p_hi
+required/CPUTime.t_o : ghc/IOBase.t_hi
+required/CPUTime.o : required/IO.hi
+required/CPUTime.mc_o : required/IO.mc_hi
+required/CPUTime.p_o : required/IO.p_hi
+required/CPUTime.t_o : required/IO.t_hi
+required/CPUTime.o : ghc/Unsafe.hi
+required/CPUTime.mc_o : ghc/Unsafe.mc_hi
+required/CPUTime.p_o : ghc/Unsafe.p_hi
+required/CPUTime.t_o : ghc/Unsafe.t_hi
+required/CPUTime.o : ghc/STBase.hi
+required/CPUTime.mc_o : ghc/STBase.mc_hi
+required/CPUTime.p_o : ghc/STBase.p_hi
+required/CPUTime.t_o : ghc/STBase.t_hi
+required/CPUTime.o : required/Ratio.hi
+required/CPUTime.mc_o : required/Ratio.mc_hi
+required/CPUTime.p_o : required/Ratio.p_hi
+required/CPUTime.t_o : required/Ratio.t_hi
+required/Char.o required/Char.mc_o required/Char.p_o required/Char.t_o : required/Char.lhs
 required/Char.o : ghc/PrelBase.hi
-required/Char.mc.o : ghc/PrelBase.mc.hi
-required/Char.norm.o : ghc/PrelBase.norm.hi
-required/Char.p.o : ghc/PrelBase.p.hi
-required/Complex.o : required/Complex.lhs
-required/Complex.mc.o : required/Complex.lhs
-required/Complex.norm.o : required/Complex.lhs
-required/Complex.p.o : required/Complex.lhs
-required/Directory.o : required/Directory.lhs
-required/Directory.mc.o : required/Directory.lhs
-required/Directory.norm.o : required/Directory.lhs
-required/Directory.p.o : required/Directory.lhs
+required/Char.mc_o : ghc/PrelBase.mc_hi
+required/Char.p_o : ghc/PrelBase.p_hi
+required/Char.t_o : ghc/PrelBase.t_hi
+required/Char.o : ghc/PrelRead.hi
+required/Char.mc_o : ghc/PrelRead.mc_hi
+required/Char.p_o : ghc/PrelRead.p_hi
+required/Char.t_o : ghc/PrelRead.t_hi
+required/Char.o : ghc/Error.hi
+required/Char.mc_o : ghc/Error.mc_hi
+required/Char.p_o : ghc/Error.p_hi
+required/Char.t_o : ghc/Error.t_hi
+required/Complex.o required/Complex.mc_o required/Complex.p_o required/Complex.t_o : required/Complex.lhs
+required/Complex.o : required/Prelude.hi
+required/Complex.mc_o : required/Prelude.mc_hi
+required/Complex.p_o : required/Prelude.p_hi
+required/Complex.t_o : required/Prelude.t_hi
+required/Directory.o required/Directory.mc_o required/Directory.p_o required/Directory.t_o : required/Directory.lhs
+required/Directory.o : ghc/PrelBase.hi
+required/Directory.mc_o : ghc/PrelBase.mc_hi
+required/Directory.p_o : ghc/PrelBase.p_hi
+required/Directory.t_o : ghc/PrelBase.t_hi
 required/Directory.o : glaExts/Foreign.hi
-required/Directory.mc.o : glaExts/Foreign.mc.hi
-required/Directory.norm.o : glaExts/Foreign.norm.hi
-required/Directory.p.o : glaExts/Foreign.p.hi
+required/Directory.mc_o : glaExts/Foreign.mc_hi
+required/Directory.p_o : glaExts/Foreign.p_hi
+required/Directory.t_o : glaExts/Foreign.t_hi
+required/Directory.o : glaExts/Addr.hi
+required/Directory.mc_o : glaExts/Addr.mc_hi
+required/Directory.p_o : glaExts/Addr.p_hi
+required/Directory.t_o : glaExts/Addr.t_hi
 required/Directory.o : ghc/IOBase.hi
-required/Directory.mc.o : ghc/IOBase.mc.hi
-required/Directory.norm.o : ghc/IOBase.norm.hi
-required/Directory.p.o : ghc/IOBase.p.hi
+required/Directory.mc_o : ghc/IOBase.mc_hi
+required/Directory.p_o : ghc/IOBase.p_hi
+required/Directory.t_o : ghc/IOBase.t_hi
 required/Directory.o : ghc/STBase.hi
-required/Directory.mc.o : ghc/STBase.mc.hi
-required/Directory.norm.o : ghc/STBase.norm.hi
-required/Directory.p.o : ghc/STBase.p.hi
-required/Directory.o : glaExts/PackedString.hi
-required/Directory.mc.o : glaExts/PackedString.mc.hi
-required/Directory.norm.o : glaExts/PackedString.norm.hi
-required/Directory.p.o : glaExts/PackedString.p.hi
-required/IO.o : required/IO.lhs
-required/IO.mc.o : required/IO.lhs
-required/IO.norm.o : required/IO.lhs
-required/IO.p.o : required/IO.lhs
-required/IO.mc.o : required/Prelude.mc.hi
-required/IO.norm.o : required/Prelude.norm.hi
-required/IO.p.o : required/Prelude.p.hi
+required/Directory.mc_o : ghc/STBase.mc_hi
+required/Directory.p_o : ghc/STBase.p_hi
+required/Directory.t_o : ghc/STBase.t_hi
+required/Directory.o : ghc/Unsafe.hi
+required/Directory.mc_o : ghc/Unsafe.mc_hi
+required/Directory.p_o : ghc/Unsafe.p_hi
+required/Directory.t_o : ghc/Unsafe.t_hi
+required/Directory.o : ghc/ArrBase.hi
+required/Directory.mc_o : ghc/ArrBase.mc_hi
+required/Directory.p_o : ghc/ArrBase.p_hi
+required/Directory.t_o : ghc/ArrBase.t_hi
+required/Directory.o : ghc/PackBase.hi
+required/Directory.mc_o : ghc/PackBase.mc_hi
+required/Directory.p_o : ghc/PackBase.p_hi
+required/Directory.t_o : ghc/PackBase.t_hi
+required/Directory.o : required/Time.hi
+required/Directory.mc_o : required/Time.mc_hi
+required/Directory.p_o : required/Time.p_hi
+required/Directory.t_o : required/Time.t_hi
+required/IO.o required/IO.mc_o required/IO.p_o required/IO.t_o : required/IO.lhs
 required/IO.o : required/Ix.hi
-required/IO.mc.o : required/Ix.mc.hi
-required/IO.norm.o : required/Ix.norm.hi
-required/IO.p.o : required/Ix.p.hi
+required/IO.mc_o : required/Ix.mc_hi
+required/IO.p_o : required/Ix.p_hi
+required/IO.t_o : required/Ix.t_hi
 required/IO.o : ghc/STBase.hi
-required/IO.mc.o : ghc/STBase.mc.hi
-required/IO.norm.o : ghc/STBase.norm.hi
-required/IO.p.o : ghc/STBase.p.hi
+required/IO.mc_o : ghc/STBase.mc_hi
+required/IO.p_o : ghc/STBase.p_hi
+required/IO.t_o : ghc/STBase.t_hi
+required/IO.o : ghc/Unsafe.hi
+required/IO.mc_o : ghc/Unsafe.mc_hi
+required/IO.p_o : ghc/Unsafe.p_hi
+required/IO.t_o : ghc/Unsafe.t_hi
 required/IO.o : ghc/IOBase.hi
-required/IO.mc.o : ghc/IOBase.mc.hi
-required/IO.norm.o : ghc/IOBase.norm.hi
-required/IO.p.o : ghc/IOBase.p.hi
+required/IO.mc_o : ghc/IOBase.mc_hi
+required/IO.p_o : ghc/IOBase.p_hi
+required/IO.t_o : ghc/IOBase.t_hi
 required/IO.o : ghc/ArrBase.hi
-required/IO.mc.o : ghc/ArrBase.mc.hi
-required/IO.norm.o : ghc/ArrBase.norm.hi
-required/IO.p.o : ghc/ArrBase.p.hi
+required/IO.mc_o : ghc/ArrBase.mc_hi
+required/IO.p_o : ghc/ArrBase.p_hi
+required/IO.t_o : ghc/ArrBase.t_hi
 required/IO.o : ghc/IOHandle.hi
-required/IO.mc.o : ghc/IOHandle.mc.hi
-required/IO.norm.o : ghc/IOHandle.norm.hi
-required/IO.p.o : ghc/IOHandle.p.hi
-required/IO.o : glaExts/PackedString.hi
-required/IO.mc.o : glaExts/PackedString.mc.hi
-required/IO.norm.o : glaExts/PackedString.norm.hi
-required/IO.p.o : glaExts/PackedString.p.hi
+required/IO.mc_o : ghc/IOHandle.mc_hi
+required/IO.p_o : ghc/IOHandle.p_hi
+required/IO.t_o : ghc/IOHandle.t_hi
+required/IO.o : ghc/PackBase.hi
+required/IO.mc_o : ghc/PackBase.mc_hi
+required/IO.p_o : ghc/PackBase.p_hi
+required/IO.t_o : ghc/PackBase.t_hi
 required/IO.o : ghc/PrelBase.hi
-required/IO.mc.o : ghc/PrelBase.mc.hi
-required/IO.norm.o : ghc/PrelBase.norm.hi
-required/IO.p.o : ghc/PrelBase.p.hi
+required/IO.mc_o : ghc/PrelBase.mc_hi
+required/IO.p_o : ghc/PrelBase.p_hi
+required/IO.t_o : ghc/PrelBase.t_hi
 required/IO.o : ghc/GHC.hi
-required/IO.mc.o : ghc/GHC.mc.hi
-required/IO.norm.o : ghc/GHC.norm.hi
-required/IO.p.o : ghc/GHC.p.hi
-required/Ix.o : required/Ix.lhs
-required/Ix.mc.o : required/Ix.lhs
-required/Ix.norm.o : required/Ix.lhs
-required/Ix.p.o : required/Ix.lhs
-required/Ix.mc.o : required/Prelude.mc.hi
-required/Ix.norm.o : required/Prelude.norm.hi
-required/Ix.p.o : required/Prelude.p.hi
-required/Ix.mc.o : ghc/IOBase.mc.hi
-required/Ix.norm.o : ghc/IOBase.norm.hi
-required/Ix.p.o : ghc/IOBase.p.hi
-required/Ix.o : ghc/PrelNum.hi
-required/Ix.mc.o : ghc/PrelNum.mc.hi
-required/Ix.norm.o : ghc/PrelNum.norm.hi
-required/Ix.p.o : ghc/PrelNum.p.hi
+required/IO.mc_o : ghc/GHC.mc_hi
+required/IO.p_o : ghc/GHC.p_hi
+required/IO.t_o : ghc/GHC.t_hi
+required/IO.o : glaExts/Addr.hi
+required/IO.mc_o : glaExts/Addr.mc_hi
+required/IO.p_o : glaExts/Addr.p_hi
+required/IO.t_o : glaExts/Addr.t_hi
+required/IO.o : glaExts/Foreign.hi
+required/IO.mc_o : glaExts/Foreign.mc_hi
+required/IO.p_o : glaExts/Foreign.p_hi
+required/IO.t_o : glaExts/Foreign.t_hi
+required/IO.o : required/Char.hi
+required/IO.mc_o : required/Char.mc_hi
+required/IO.p_o : required/Char.p_hi
+required/IO.t_o : required/Char.t_hi
+required/Ix.o required/Ix.mc_o required/Ix.p_o required/Ix.t_o : required/Ix.lhs
+required/Ix.o required/Ix.mc_o required/Ix.p_o required/Ix.t_o : ghc/Error.hi-boot
 required/Ix.o : ghc/PrelTup.hi
-required/Ix.mc.o : ghc/PrelTup.mc.hi
-required/Ix.norm.o : ghc/PrelTup.norm.hi
-required/Ix.p.o : ghc/PrelTup.p.hi
+required/Ix.mc_o : ghc/PrelTup.mc_hi
+required/Ix.p_o : ghc/PrelTup.p_hi
+required/Ix.t_o : ghc/PrelTup.t_hi
 required/Ix.o : ghc/PrelBase.hi
-required/Ix.mc.o : ghc/PrelBase.mc.hi
-required/Ix.norm.o : ghc/PrelBase.norm.hi
-required/Ix.p.o : ghc/PrelBase.p.hi
-required/List.o : required/List.lhs
-required/List.mc.o : required/List.lhs
-required/List.norm.o : required/List.lhs
-required/List.p.o : required/List.lhs
-required/List.mc.o : required/Prelude.mc.hi
-required/List.norm.o : required/Prelude.norm.hi
-required/List.p.o : required/Prelude.p.hi
-required/Maybe.o : required/Maybe.lhs
-required/Maybe.mc.o : required/Maybe.lhs
-required/Maybe.norm.o : required/Maybe.lhs
-required/Maybe.p.o : required/Maybe.lhs
-required/Maybe.mc.o : required/Prelude.mc.hi
-required/Maybe.norm.o : required/Prelude.norm.hi
-required/Maybe.p.o : required/Prelude.p.hi
-required/Maybe.mc.o : ghc/IOBase.mc.hi
-required/Maybe.norm.o : ghc/IOBase.norm.hi
-required/Maybe.p.o : ghc/IOBase.p.hi
+required/Ix.mc_o : ghc/PrelBase.mc_hi
+required/Ix.p_o : ghc/PrelBase.p_hi
+required/Ix.t_o : ghc/PrelBase.t_hi
+required/List.o required/List.mc_o required/List.p_o required/List.t_o : required/List.lhs
+required/List.o : required/Prelude.hi
+required/List.mc_o : required/Prelude.mc_hi
+required/List.p_o : required/Prelude.p_hi
+required/List.t_o : required/Prelude.t_hi
+required/List.o : required/Maybe.hi
+required/List.mc_o : required/Maybe.mc_hi
+required/List.p_o : required/Maybe.p_hi
+required/List.t_o : required/Maybe.t_hi
+required/Locale.o required/Locale.mc_o required/Locale.p_o required/Locale.t_o : required/Locale.lhs
+required/Maybe.o required/Maybe.mc_o required/Maybe.p_o required/Maybe.t_o : required/Maybe.lhs
+required/Maybe.o : ghc/Error.hi
+required/Maybe.mc_o : ghc/Error.mc_hi
+required/Maybe.p_o : ghc/Error.p_hi
+required/Maybe.t_o : ghc/Error.t_hi
 required/Maybe.o : required/Monad.hi
-required/Maybe.mc.o : required/Monad.mc.hi
-required/Maybe.norm.o : required/Monad.norm.hi
-required/Maybe.p.o : required/Monad.p.hi
+required/Maybe.mc_o : required/Monad.mc_hi
+required/Maybe.p_o : required/Monad.p_hi
+required/Maybe.t_o : required/Monad.t_hi
 required/Maybe.o : ghc/PrelList.hi
-required/Maybe.mc.o : ghc/PrelList.mc.hi
-required/Maybe.norm.o : ghc/PrelList.norm.hi
-required/Maybe.p.o : ghc/PrelList.p.hi
+required/Maybe.mc_o : ghc/PrelList.mc_hi
+required/Maybe.p_o : ghc/PrelList.p_hi
+required/Maybe.t_o : ghc/PrelList.t_hi
 required/Maybe.o : ghc/PrelBase.hi
-required/Maybe.mc.o : ghc/PrelBase.mc.hi
-required/Maybe.norm.o : ghc/PrelBase.norm.hi
-required/Maybe.p.o : ghc/PrelBase.p.hi
-required/Monad.o : required/Monad.lhs
-required/Monad.mc.o : required/Monad.lhs
-required/Monad.norm.o : required/Monad.lhs
-required/Monad.p.o : required/Monad.lhs
-required/Monad.mc.o : required/Prelude.mc.hi
-required/Monad.norm.o : required/Prelude.norm.hi
-required/Monad.p.o : required/Prelude.p.hi
+required/Maybe.mc_o : ghc/PrelBase.mc_hi
+required/Maybe.p_o : ghc/PrelBase.p_hi
+required/Maybe.t_o : ghc/PrelBase.t_hi
+required/Monad.o required/Monad.mc_o required/Monad.p_o required/Monad.t_o : required/Monad.lhs
 required/Monad.o : ghc/PrelList.hi
-required/Monad.mc.o : ghc/PrelList.mc.hi
-required/Monad.norm.o : ghc/PrelList.norm.hi
-required/Monad.p.o : ghc/PrelList.p.hi
+required/Monad.mc_o : ghc/PrelList.mc_hi
+required/Monad.p_o : ghc/PrelList.p_hi
+required/Monad.t_o : ghc/PrelList.t_hi
 required/Monad.o : ghc/PrelTup.hi
-required/Monad.mc.o : ghc/PrelTup.mc.hi
-required/Monad.norm.o : ghc/PrelTup.norm.hi
-required/Monad.p.o : ghc/PrelTup.p.hi
+required/Monad.mc_o : ghc/PrelTup.mc_hi
+required/Monad.p_o : ghc/PrelTup.p_hi
+required/Monad.t_o : ghc/PrelTup.t_hi
 required/Monad.o : ghc/PrelBase.hi
-required/Monad.mc.o : ghc/PrelBase.mc.hi
-required/Monad.norm.o : ghc/PrelBase.norm.hi
-required/Monad.p.o : ghc/PrelBase.p.hi
-required/Prelude.o : required/Prelude.lhs
-required/Prelude.mc.o : required/Prelude.lhs
-required/Prelude.norm.o : required/Prelude.lhs
-required/Prelude.p.o : required/Prelude.lhs
+required/Monad.mc_o : ghc/PrelBase.mc_hi
+required/Monad.p_o : ghc/PrelBase.p_hi
+required/Monad.t_o : ghc/PrelBase.t_hi
+required/Numeric.o required/Numeric.mc_o required/Numeric.p_o required/Numeric.t_o : required/Numeric.lhs
+required/Numeric.o : ghc/PrelBase.hi
+required/Numeric.mc_o : ghc/PrelBase.mc_hi
+required/Numeric.p_o : ghc/PrelBase.p_hi
+required/Numeric.t_o : ghc/PrelBase.t_hi
+required/Numeric.o : ghc/ArrBase.hi
+required/Numeric.mc_o : ghc/ArrBase.mc_hi
+required/Numeric.p_o : ghc/ArrBase.p_hi
+required/Numeric.t_o : ghc/ArrBase.t_hi
+required/Numeric.o : ghc/PrelNum.hi
+required/Numeric.mc_o : ghc/PrelNum.mc_hi
+required/Numeric.p_o : ghc/PrelNum.p_hi
+required/Numeric.t_o : ghc/PrelNum.t_hi
+required/Numeric.o : ghc/PrelRead.hi
+required/Numeric.mc_o : ghc/PrelRead.mc_hi
+required/Numeric.p_o : ghc/PrelRead.p_hi
+required/Numeric.t_o : ghc/PrelRead.t_hi
+required/Prelude.o required/Prelude.mc_o required/Prelude.p_o required/Prelude.t_o : required/Prelude.lhs
 required/Prelude.o : ghc/PrelBase.hi
-required/Prelude.mc.o : ghc/PrelBase.mc.hi
-required/Prelude.norm.o : ghc/PrelBase.norm.hi
-required/Prelude.p.o : ghc/PrelBase.p.hi
+required/Prelude.mc_o : ghc/PrelBase.mc_hi
+required/Prelude.p_o : ghc/PrelBase.p_hi
+required/Prelude.t_o : ghc/PrelBase.t_hi
 required/Prelude.o : ghc/PrelList.hi
-required/Prelude.mc.o : ghc/PrelList.mc.hi
-required/Prelude.norm.o : ghc/PrelList.norm.hi
-required/Prelude.p.o : ghc/PrelList.p.hi
+required/Prelude.mc_o : ghc/PrelList.mc_hi
+required/Prelude.p_o : ghc/PrelList.p_hi
+required/Prelude.t_o : ghc/PrelList.t_hi
 required/Prelude.o : ghc/PrelIO.hi
-required/Prelude.mc.o : ghc/PrelIO.mc.hi
-required/Prelude.norm.o : ghc/PrelIO.norm.hi
-required/Prelude.p.o : ghc/PrelIO.p.hi
+required/Prelude.mc_o : ghc/PrelIO.mc_hi
+required/Prelude.p_o : ghc/PrelIO.p_hi
+required/Prelude.t_o : ghc/PrelIO.t_hi
 required/Prelude.o : ghc/PrelRead.hi
-required/Prelude.mc.o : ghc/PrelRead.mc.hi
-required/Prelude.norm.o : ghc/PrelRead.norm.hi
-required/Prelude.p.o : ghc/PrelRead.p.hi
+required/Prelude.mc_o : ghc/PrelRead.mc_hi
+required/Prelude.p_o : ghc/PrelRead.p_hi
+required/Prelude.t_o : ghc/PrelRead.t_hi
 required/Prelude.o : ghc/PrelNum.hi
-required/Prelude.mc.o : ghc/PrelNum.mc.hi
-required/Prelude.norm.o : ghc/PrelNum.norm.hi
-required/Prelude.p.o : ghc/PrelNum.p.hi
+required/Prelude.mc_o : ghc/PrelNum.mc_hi
+required/Prelude.p_o : ghc/PrelNum.p_hi
+required/Prelude.t_o : ghc/PrelNum.t_hi
 required/Prelude.o : ghc/PrelTup.hi
-required/Prelude.mc.o : ghc/PrelTup.mc.hi
-required/Prelude.norm.o : ghc/PrelTup.norm.hi
-required/Prelude.p.o : ghc/PrelTup.p.hi
+required/Prelude.mc_o : ghc/PrelTup.mc_hi
+required/Prelude.p_o : ghc/PrelTup.p_hi
+required/Prelude.t_o : ghc/PrelTup.t_hi
 required/Prelude.o : required/Monad.hi
-required/Prelude.mc.o : required/Monad.mc.hi
-required/Prelude.norm.o : required/Monad.norm.hi
-required/Prelude.p.o : required/Monad.p.hi
+required/Prelude.mc_o : required/Monad.mc_hi
+required/Prelude.p_o : required/Monad.p_hi
+required/Prelude.t_o : required/Monad.t_hi
 required/Prelude.o : required/Maybe.hi
-required/Prelude.mc.o : required/Maybe.mc.hi
-required/Prelude.norm.o : required/Maybe.norm.hi
-required/Prelude.p.o : required/Maybe.p.hi
-required/Prelude.o : ghc/IOBase.hi
-required/Prelude.mc.o : ghc/IOBase.mc.hi
-required/Prelude.norm.o : ghc/IOBase.norm.hi
-required/Prelude.p.o : ghc/IOBase.p.hi
-required/Ratio.o : required/Ratio.lhs
-required/Ratio.mc.o : required/Ratio.lhs
-required/Ratio.norm.o : required/Ratio.lhs
-required/Ratio.p.o : required/Ratio.lhs
-required/Ratio.mc.o : required/Prelude.mc.hi
-required/Ratio.norm.o : required/Prelude.norm.hi
-required/Ratio.p.o : required/Prelude.p.hi
+required/Prelude.mc_o : required/Maybe.mc_hi
+required/Prelude.p_o : required/Maybe.p_hi
+required/Prelude.t_o : required/Maybe.t_hi
+required/Prelude.o : ghc/Error.hi
+required/Prelude.mc_o : ghc/Error.mc_hi
+required/Prelude.p_o : ghc/Error.p_hi
+required/Prelude.t_o : ghc/Error.t_hi
+required/Prelude.o : ghc/GHCerr.hi
+required/Prelude.mc_o : ghc/GHCerr.mc_hi
+required/Prelude.p_o : ghc/GHCerr.p_hi
+required/Prelude.t_o : ghc/GHCerr.t_hi
+required/Random.o required/Random.mc_o required/Random.p_o required/Random.t_o : required/Random.lhs
+required/Random.o : required/CPUTime.hi
+required/Random.mc_o : required/CPUTime.mc_hi
+required/Random.p_o : required/CPUTime.p_hi
+required/Random.t_o : required/CPUTime.t_hi
+required/Random.o : required/Time.hi
+required/Random.mc_o : required/Time.mc_hi
+required/Random.p_o : required/Time.p_hi
+required/Random.t_o : required/Time.t_hi
+required/Ratio.o required/Ratio.mc_o required/Ratio.p_o required/Ratio.t_o : required/Ratio.lhs
 required/Ratio.o : ghc/PrelNum.hi
-required/Ratio.mc.o : ghc/PrelNum.mc.hi
-required/Ratio.norm.o : ghc/PrelNum.norm.hi
-required/Ratio.p.o : ghc/PrelNum.p.hi
-required/System.o : required/System.lhs
-required/System.mc.o : required/System.lhs
-required/System.norm.o : required/System.lhs
-required/System.p.o : required/System.lhs
-required/System.o : glaExts/Foreign.hi
-required/System.mc.o : glaExts/Foreign.mc.hi
-required/System.norm.o : glaExts/Foreign.norm.hi
-required/System.p.o : glaExts/Foreign.p.hi
+required/Ratio.mc_o : ghc/PrelNum.mc_hi
+required/Ratio.p_o : ghc/PrelNum.p_hi
+required/Ratio.t_o : ghc/PrelNum.t_hi
+required/System.o required/System.mc_o required/System.p_o required/System.t_o : required/System.lhs
+required/System.o : required/Prelude.hi
+required/System.mc_o : required/Prelude.mc_hi
+required/System.p_o : required/Prelude.p_hi
+required/System.t_o : required/Prelude.t_hi
+required/System.o : glaExts/Addr.hi
+required/System.mc_o : glaExts/Addr.mc_hi
+required/System.p_o : glaExts/Addr.p_hi
+required/System.t_o : glaExts/Addr.t_hi
 required/System.o : ghc/IOBase.hi
-required/System.mc.o : ghc/IOBase.mc.hi
-required/System.norm.o : ghc/IOBase.norm.hi
-required/System.p.o : ghc/IOBase.p.hi
+required/System.mc_o : ghc/IOBase.mc_hi
+required/System.p_o : ghc/IOBase.p_hi
+required/System.t_o : ghc/IOBase.t_hi
 required/System.o : ghc/ArrBase.hi
-required/System.mc.o : ghc/ArrBase.mc.hi
-required/System.norm.o : ghc/ArrBase.norm.hi
-required/System.p.o : ghc/ArrBase.p.hi
-required/System.o : glaExts/PackedString.hi
-required/System.mc.o : glaExts/PackedString.mc.hi
-required/System.norm.o : glaExts/PackedString.norm.hi
-required/System.p.o : glaExts/PackedString.p.hi
-glaExts/Foreign.o : glaExts/Foreign.lhs
-glaExts/Foreign.mc.o : glaExts/Foreign.lhs
-glaExts/Foreign.norm.o : glaExts/Foreign.lhs
-glaExts/Foreign.p.o : glaExts/Foreign.lhs
-glaExts/Foreign.mc.o : required/Prelude.mc.hi
-glaExts/Foreign.norm.o : required/Prelude.norm.hi
-glaExts/Foreign.p.o : required/Prelude.p.hi
+required/System.mc_o : ghc/ArrBase.mc_hi
+required/System.p_o : ghc/ArrBase.p_hi
+required/System.t_o : ghc/ArrBase.t_hi
+required/System.o : ghc/PackBase.hi
+required/System.mc_o : ghc/PackBase.mc_hi
+required/System.p_o : ghc/PackBase.p_hi
+required/System.t_o : ghc/PackBase.t_hi
+required/Time.o required/Time.mc_o required/Time.p_o required/Time.t_o : required/Time.lhs
+required/Time.o : ghc/PrelBase.hi
+required/Time.mc_o : ghc/PrelBase.mc_hi
+required/Time.p_o : ghc/PrelBase.p_hi
+required/Time.t_o : ghc/PrelBase.t_hi
+required/Time.o : glaExts/ST.hi
+required/Time.mc_o : glaExts/ST.mc_hi
+required/Time.p_o : glaExts/ST.p_hi
+required/Time.t_o : glaExts/ST.t_hi
+required/Time.o : ghc/IOBase.hi
+required/Time.mc_o : ghc/IOBase.mc_hi
+required/Time.p_o : ghc/IOBase.p_hi
+required/Time.t_o : ghc/IOBase.t_hi
+required/Time.o : ghc/ArrBase.hi
+required/Time.mc_o : ghc/ArrBase.mc_hi
+required/Time.p_o : ghc/ArrBase.p_hi
+required/Time.t_o : ghc/ArrBase.t_hi
+required/Time.o : ghc/STBase.hi
+required/Time.mc_o : ghc/STBase.mc_hi
+required/Time.p_o : ghc/STBase.p_hi
+required/Time.t_o : ghc/STBase.t_hi
+required/Time.o : ghc/Unsafe.hi
+required/Time.mc_o : ghc/Unsafe.mc_hi
+required/Time.p_o : ghc/Unsafe.p_hi
+required/Time.t_o : ghc/Unsafe.t_hi
+required/Time.o : glaExts/ST.hi
+required/Time.mc_o : glaExts/ST.mc_hi
+required/Time.p_o : glaExts/ST.p_hi
+required/Time.t_o : glaExts/ST.t_hi
+required/Time.o : required/Ix.hi
+required/Time.mc_o : required/Ix.mc_hi
+required/Time.p_o : required/Ix.p_hi
+required/Time.t_o : required/Ix.t_hi
+required/Time.o : glaExts/Addr.hi
+required/Time.mc_o : glaExts/Addr.mc_hi
+required/Time.p_o : glaExts/Addr.p_hi
+required/Time.t_o : glaExts/Addr.t_hi
+required/Time.o : required/Char.hi
+required/Time.mc_o : required/Char.mc_hi
+required/Time.p_o : required/Char.p_hi
+required/Time.t_o : required/Char.t_hi
+required/Time.o : ghc/PackBase.hi
+required/Time.mc_o : ghc/PackBase.mc_hi
+required/Time.p_o : ghc/PackBase.p_hi
+required/Time.t_o : ghc/PackBase.t_hi
+required/Time.o : required/Locale.hi
+required/Time.mc_o : required/Locale.mc_hi
+required/Time.p_o : required/Locale.p_hi
+required/Time.t_o : required/Locale.t_hi
+glaExts/Addr.o glaExts/Addr.mc_o glaExts/Addr.p_o glaExts/Addr.t_o : glaExts/Addr.lhs
+glaExts/Addr.o : ghc/GHC.hi
+glaExts/Addr.mc_o : ghc/GHC.mc_hi
+glaExts/Addr.p_o : ghc/GHC.p_hi
+glaExts/Addr.t_o : ghc/GHC.t_hi
+glaExts/Addr.o : ghc/PrelBase.hi
+glaExts/Addr.mc_o : ghc/PrelBase.mc_hi
+glaExts/Addr.p_o : ghc/PrelBase.p_hi
+glaExts/Addr.t_o : ghc/PrelBase.t_hi
+glaExts/Addr.o : ghc/STBase.hi
+glaExts/Addr.mc_o : ghc/STBase.mc_hi
+glaExts/Addr.p_o : ghc/STBase.p_hi
+glaExts/Addr.t_o : ghc/STBase.t_hi
+glaExts/Addr.o : glaExts/CCall.hi
+glaExts/Addr.mc_o : glaExts/CCall.mc_hi
+glaExts/Addr.p_o : glaExts/CCall.p_hi
+glaExts/Addr.t_o : glaExts/CCall.t_hi
+glaExts/Bits.o glaExts/Bits.mc_o glaExts/Bits.p_o glaExts/Bits.t_o : glaExts/Bits.lhs
+glaExts/Bits.o : ghc/PrelBase.hi
+glaExts/Bits.mc_o : ghc/PrelBase.mc_hi
+glaExts/Bits.p_o : ghc/PrelBase.p_hi
+glaExts/Bits.t_o : ghc/PrelBase.t_hi
+glaExts/ByteArray.o glaExts/ByteArray.mc_o glaExts/ByteArray.p_o glaExts/ByteArray.t_o : glaExts/ByteArray.lhs
+glaExts/ByteArray.o : ghc/ArrBase.hi
+glaExts/ByteArray.mc_o : ghc/ArrBase.mc_hi
+glaExts/ByteArray.p_o : ghc/ArrBase.p_hi
+glaExts/ByteArray.t_o : ghc/ArrBase.t_hi
+glaExts/ByteArray.o : required/Ix.hi
+glaExts/ByteArray.mc_o : required/Ix.mc_hi
+glaExts/ByteArray.p_o : required/Ix.p_hi
+glaExts/ByteArray.t_o : required/Ix.t_hi
+glaExts/ByteArray.o : glaExts/Foreign.hi
+glaExts/ByteArray.mc_o : glaExts/Foreign.mc_hi
+glaExts/ByteArray.p_o : glaExts/Foreign.p_hi
+glaExts/ByteArray.t_o : glaExts/Foreign.t_hi
+glaExts/ByteArray.o : glaExts/Addr.hi
+glaExts/ByteArray.mc_o : glaExts/Addr.mc_hi
+glaExts/ByteArray.p_o : glaExts/Addr.p_hi
+glaExts/ByteArray.t_o : glaExts/Addr.t_hi
+glaExts/CCall.o glaExts/CCall.mc_o glaExts/CCall.p_o glaExts/CCall.t_o : glaExts/CCall.lhs
+glaExts/CCall.o : ghc/PrelBase.hi
+glaExts/CCall.mc_o : ghc/PrelBase.mc_hi
+glaExts/CCall.p_o : ghc/PrelBase.p_hi
+glaExts/CCall.t_o : ghc/PrelBase.t_hi
+glaExts/CCall.o : ghc/GHC.hi
+glaExts/CCall.mc_o : ghc/GHC.mc_hi
+glaExts/CCall.p_o : ghc/GHC.p_hi
+glaExts/CCall.t_o : ghc/GHC.t_hi
+glaExts/Foreign.o glaExts/Foreign.mc_o glaExts/Foreign.p_o glaExts/Foreign.t_o : glaExts/Foreign.lhs
+glaExts/Foreign.o : ghc/IOBase.hi
+glaExts/Foreign.mc_o : ghc/IOBase.mc_hi
+glaExts/Foreign.p_o : ghc/IOBase.p_hi
+glaExts/Foreign.t_o : ghc/IOBase.t_hi
 glaExts/Foreign.o : ghc/STBase.hi
-glaExts/Foreign.mc.o : ghc/STBase.mc.hi
-glaExts/Foreign.norm.o : ghc/STBase.norm.hi
-glaExts/Foreign.p.o : ghc/STBase.p.hi
-glaExts/Foreign.o : ghc/ArrBase.hi
-glaExts/Foreign.mc.o : ghc/ArrBase.mc.hi
-glaExts/Foreign.norm.o : ghc/ArrBase.norm.hi
-glaExts/Foreign.p.o : ghc/ArrBase.p.hi
-glaExts/Foreign.o : ghc/PrelNum.hi
-glaExts/Foreign.mc.o : ghc/PrelNum.mc.hi
-glaExts/Foreign.norm.o : ghc/PrelNum.norm.hi
-glaExts/Foreign.p.o : ghc/PrelNum.p.hi
+glaExts/Foreign.mc_o : ghc/STBase.mc_hi
+glaExts/Foreign.p_o : ghc/STBase.p_hi
+glaExts/Foreign.t_o : ghc/STBase.t_hi
+glaExts/Foreign.o : ghc/Unsafe.hi
+glaExts/Foreign.mc_o : ghc/Unsafe.mc_hi
+glaExts/Foreign.p_o : ghc/Unsafe.p_hi
+glaExts/Foreign.t_o : ghc/Unsafe.t_hi
 glaExts/Foreign.o : ghc/PrelBase.hi
-glaExts/Foreign.mc.o : ghc/PrelBase.mc.hi
-glaExts/Foreign.norm.o : ghc/PrelBase.norm.hi
-glaExts/Foreign.p.o : ghc/PrelBase.p.hi
+glaExts/Foreign.mc_o : ghc/PrelBase.mc_hi
+glaExts/Foreign.p_o : ghc/PrelBase.p_hi
+glaExts/Foreign.t_o : ghc/PrelBase.t_hi
+glaExts/Foreign.o : glaExts/CCall.hi
+glaExts/Foreign.mc_o : glaExts/CCall.mc_hi
+glaExts/Foreign.p_o : glaExts/CCall.p_hi
+glaExts/Foreign.t_o : glaExts/CCall.t_hi
+glaExts/Foreign.o : glaExts/Addr.hi
+glaExts/Foreign.mc_o : glaExts/Addr.mc_hi
+glaExts/Foreign.p_o : glaExts/Addr.p_hi
+glaExts/Foreign.t_o : glaExts/Addr.t_hi
 glaExts/Foreign.o : ghc/GHC.hi
-glaExts/Foreign.mc.o : ghc/GHC.mc.hi
-glaExts/Foreign.norm.o : ghc/GHC.norm.hi
-glaExts/Foreign.p.o : ghc/GHC.p.hi
-glaExts/PackedString.o : glaExts/PackedString.lhs
-glaExts/PackedString.mc.o : glaExts/PackedString.lhs
-glaExts/PackedString.norm.o : glaExts/PackedString.lhs
-glaExts/PackedString.p.o : glaExts/PackedString.lhs
-glaExts/PackedString.mc.o : required/Prelude.mc.hi
-glaExts/PackedString.norm.o : required/Prelude.norm.hi
-glaExts/PackedString.p.o : required/Prelude.p.hi
-glaExts/PackedString.mc.o : ghc/IOBase.mc.hi
-glaExts/PackedString.norm.o : ghc/IOBase.norm.hi
-glaExts/PackedString.p.o : ghc/IOBase.p.hi
-glaExts/PackedString.o : required/Ix.hi
-glaExts/PackedString.mc.o : required/Ix.mc.hi
-glaExts/PackedString.norm.o : required/Ix.norm.hi
-glaExts/PackedString.p.o : required/Ix.p.hi
-glaExts/PackedString.o : ghc/PrelList.hi
-glaExts/PackedString.mc.o : ghc/PrelList.mc.hi
-glaExts/PackedString.norm.o : ghc/PrelList.norm.hi
-glaExts/PackedString.p.o : ghc/PrelList.p.hi
-glaExts/PackedString.o : ghc/STBase.hi
-glaExts/PackedString.mc.o : ghc/STBase.mc.hi
-glaExts/PackedString.norm.o : ghc/STBase.norm.hi
-glaExts/PackedString.p.o : ghc/STBase.p.hi
-glaExts/PackedString.o : ghc/ArrBase.hi
-glaExts/PackedString.mc.o : ghc/ArrBase.mc.hi
-glaExts/PackedString.norm.o : ghc/ArrBase.norm.hi
-glaExts/PackedString.p.o : ghc/ArrBase.p.hi
-glaExts/PackedString.o : ghc/PrelBase.hi
-glaExts/PackedString.mc.o : ghc/PrelBase.mc.hi
-glaExts/PackedString.norm.o : ghc/PrelBase.norm.hi
-glaExts/PackedString.p.o : ghc/PrelBase.p.hi
-glaExts/PackedString.o : ghc/GHC.hi
-glaExts/PackedString.mc.o : ghc/GHC.mc.hi
-glaExts/PackedString.norm.o : ghc/GHC.norm.hi
-glaExts/PackedString.p.o : ghc/GHC.p.hi
-glaExts/ST.o : glaExts/ST.lhs
-glaExts/ST.mc.o : glaExts/ST.lhs
-glaExts/ST.norm.o : glaExts/ST.lhs
-glaExts/ST.p.o : glaExts/ST.lhs
-glaExts/ST.mc.o : required/Prelude.mc.hi
-glaExts/ST.norm.o : required/Prelude.norm.hi
-glaExts/ST.p.o : required/Prelude.p.hi
-glaExts/ST.mc.o : ghc/IOBase.mc.hi
-glaExts/ST.norm.o : ghc/IOBase.norm.hi
-glaExts/ST.p.o : ghc/IOBase.p.hi
+glaExts/Foreign.mc_o : ghc/GHC.mc_hi
+glaExts/Foreign.p_o : ghc/GHC.p_hi
+glaExts/Foreign.t_o : ghc/GHC.t_hi
+glaExts/GlaExts.o glaExts/GlaExts.mc_o glaExts/GlaExts.p_o glaExts/GlaExts.t_o : glaExts/GlaExts.lhs
+glaExts/GlaExts.o : ghc/GHC.hi
+glaExts/GlaExts.mc_o : ghc/GHC.mc_hi
+glaExts/GlaExts.p_o : ghc/GHC.p_hi
+glaExts/GlaExts.t_o : ghc/GHC.t_hi
+glaExts/GlaExts.o : ghc/STBase.hi
+glaExts/GlaExts.mc_o : ghc/STBase.mc_hi
+glaExts/GlaExts.p_o : ghc/STBase.p_hi
+glaExts/GlaExts.t_o : ghc/STBase.t_hi
+glaExts/GlaExts.o : glaExts/IOExts.hi
+glaExts/GlaExts.mc_o : glaExts/IOExts.mc_hi
+glaExts/GlaExts.p_o : glaExts/IOExts.p_hi
+glaExts/GlaExts.t_o : glaExts/IOExts.t_hi
+glaExts/GlaExts.o : ghc/PrelBase.hi
+glaExts/GlaExts.mc_o : ghc/PrelBase.mc_hi
+glaExts/GlaExts.p_o : ghc/PrelBase.p_hi
+glaExts/GlaExts.t_o : ghc/PrelBase.t_hi
+glaExts/GlaExts.o : glaExts/ByteArray.hi
+glaExts/GlaExts.mc_o : glaExts/ByteArray.mc_hi
+glaExts/GlaExts.p_o : glaExts/ByteArray.p_hi
+glaExts/GlaExts.t_o : glaExts/ByteArray.t_hi
+glaExts/GlaExts.o : glaExts/MutableArray.hi
+glaExts/GlaExts.mc_o : glaExts/MutableArray.mc_hi
+glaExts/GlaExts.p_o : glaExts/MutableArray.p_hi
+glaExts/GlaExts.t_o : glaExts/MutableArray.t_hi
+glaExts/GlaExts.o : required/Monad.hi
+glaExts/GlaExts.mc_o : required/Monad.mc_hi
+glaExts/GlaExts.p_o : required/Monad.p_hi
+glaExts/GlaExts.t_o : required/Monad.t_hi
+glaExts/GlaExts.o : ghc/IOBase.hi
+glaExts/GlaExts.mc_o : ghc/IOBase.mc_hi
+glaExts/GlaExts.p_o : ghc/IOBase.p_hi
+glaExts/GlaExts.t_o : ghc/IOBase.t_hi
+glaExts/GlaExts.o : glaExts/Foreign.hi
+glaExts/GlaExts.mc_o : glaExts/Foreign.mc_hi
+glaExts/GlaExts.p_o : glaExts/Foreign.p_hi
+glaExts/GlaExts.t_o : glaExts/Foreign.t_hi
+glaExts/IOExts.o glaExts/IOExts.mc_o glaExts/IOExts.p_o glaExts/IOExts.t_o : glaExts/IOExts.lhs
+glaExts/IOExts.o : ghc/IOBase.hi
+glaExts/IOExts.mc_o : ghc/IOBase.mc_hi
+glaExts/IOExts.p_o : ghc/IOBase.p_hi
+glaExts/IOExts.t_o : ghc/IOBase.t_hi
+glaExts/IOExts.o : ghc/IORef.hi
+glaExts/IOExts.mc_o : ghc/IORef.mc_hi
+glaExts/IOExts.p_o : ghc/IORef.p_hi
+glaExts/IOExts.t_o : ghc/IORef.t_hi
+glaExts/IOExts.o : ghc/STBase.hi
+glaExts/IOExts.mc_o : ghc/STBase.mc_hi
+glaExts/IOExts.p_o : ghc/STBase.p_hi
+glaExts/IOExts.t_o : ghc/STBase.t_hi
+glaExts/IOExts.o : ghc/Unsafe.hi
+glaExts/IOExts.mc_o : ghc/Unsafe.mc_hi
+glaExts/IOExts.p_o : ghc/Unsafe.p_hi
+glaExts/IOExts.t_o : ghc/Unsafe.t_hi
+glaExts/Int.o glaExts/Int.mc_o glaExts/Int.p_o glaExts/Int.t_o : glaExts/Int.lhs
+glaExts/Int.o : ghc/PrelBase.hi
+glaExts/Int.mc_o : ghc/PrelBase.mc_hi
+glaExts/Int.p_o : ghc/PrelBase.p_hi
+glaExts/Int.t_o : ghc/PrelBase.t_hi
+glaExts/Int.o : ghc/PrelNum.hi
+glaExts/Int.mc_o : ghc/PrelNum.mc_hi
+glaExts/Int.p_o : ghc/PrelNum.p_hi
+glaExts/Int.t_o : ghc/PrelNum.t_hi
+glaExts/Int.o : ghc/PrelRead.hi
+glaExts/Int.mc_o : ghc/PrelRead.mc_hi
+glaExts/Int.p_o : ghc/PrelRead.p_hi
+glaExts/Int.t_o : ghc/PrelRead.t_hi
+glaExts/Int.o : required/Ix.hi
+glaExts/Int.mc_o : required/Ix.mc_hi
+glaExts/Int.p_o : required/Ix.p_hi
+glaExts/Int.t_o : required/Ix.t_hi
+glaExts/Int.o : ghc/Error.hi
+glaExts/Int.mc_o : ghc/Error.mc_hi
+glaExts/Int.p_o : ghc/Error.p_hi
+glaExts/Int.t_o : ghc/Error.t_hi
+glaExts/Int.o : glaExts/Bits.hi
+glaExts/Int.mc_o : glaExts/Bits.mc_hi
+glaExts/Int.p_o : glaExts/Bits.p_hi
+glaExts/Int.t_o : glaExts/Bits.t_hi
+glaExts/Int.o : ghc/GHC.hi
+glaExts/Int.mc_o : ghc/GHC.mc_hi
+glaExts/Int.p_o : ghc/GHC.p_hi
+glaExts/Int.t_o : ghc/GHC.t_hi
+glaExts/LazyST.o glaExts/LazyST.mc_o glaExts/LazyST.p_o glaExts/LazyST.t_o : glaExts/LazyST.lhs
+glaExts/LazyST.o : glaExts/ST.hi
+glaExts/LazyST.mc_o : glaExts/ST.mc_hi
+glaExts/LazyST.p_o : glaExts/ST.p_hi
+glaExts/LazyST.t_o : glaExts/ST.t_hi
+glaExts/LazyST.o : ghc/STBase.hi
+glaExts/LazyST.mc_o : ghc/STBase.mc_hi
+glaExts/LazyST.p_o : ghc/STBase.p_hi
+glaExts/LazyST.t_o : ghc/STBase.t_hi
+glaExts/LazyST.o : ghc/ArrBase.hi
+glaExts/LazyST.mc_o : ghc/ArrBase.mc_hi
+glaExts/LazyST.p_o : ghc/ArrBase.p_hi
+glaExts/LazyST.t_o : ghc/ArrBase.t_hi
+glaExts/LazyST.o : ghc/Unsafe.hi
+glaExts/LazyST.mc_o : ghc/Unsafe.mc_hi
+glaExts/LazyST.p_o : ghc/Unsafe.p_hi
+glaExts/LazyST.t_o : ghc/Unsafe.t_hi
+glaExts/LazyST.o : ghc/PrelBase.hi
+glaExts/LazyST.mc_o : ghc/PrelBase.mc_hi
+glaExts/LazyST.p_o : ghc/PrelBase.p_hi
+glaExts/LazyST.t_o : ghc/PrelBase.t_hi
+glaExts/LazyST.o : required/Monad.hi
+glaExts/LazyST.mc_o : required/Monad.mc_hi
+glaExts/LazyST.p_o : required/Monad.p_hi
+glaExts/LazyST.t_o : required/Monad.t_hi
+glaExts/LazyST.o : required/Ix.hi
+glaExts/LazyST.mc_o : required/Ix.mc_hi
+glaExts/LazyST.p_o : required/Ix.p_hi
+glaExts/LazyST.t_o : required/Ix.t_hi
+glaExts/MutableArray.o glaExts/MutableArray.mc_o glaExts/MutableArray.p_o glaExts/MutableArray.t_o : glaExts/MutableArray.lhs
+glaExts/MutableArray.o : ghc/ArrBase.hi
+glaExts/MutableArray.mc_o : ghc/ArrBase.mc_hi
+glaExts/MutableArray.p_o : ghc/ArrBase.p_hi
+glaExts/MutableArray.t_o : ghc/ArrBase.t_hi
+glaExts/MutableArray.o : glaExts/ST.hi
+glaExts/MutableArray.mc_o : glaExts/ST.mc_hi
+glaExts/MutableArray.p_o : glaExts/ST.p_hi
+glaExts/MutableArray.t_o : glaExts/ST.t_hi
+glaExts/MutableArray.o : required/Ix.hi
+glaExts/MutableArray.mc_o : required/Ix.mc_hi
+glaExts/MutableArray.p_o : required/Ix.p_hi
+glaExts/MutableArray.t_o : required/Ix.t_hi
+glaExts/ST.o glaExts/ST.mc_o glaExts/ST.p_o glaExts/ST.t_o : glaExts/ST.lhs
 glaExts/ST.o : ghc/ArrBase.hi
-glaExts/ST.mc.o : ghc/ArrBase.mc.hi
-glaExts/ST.norm.o : ghc/ArrBase.norm.hi
-glaExts/ST.p.o : ghc/ArrBase.p.hi
+glaExts/ST.mc_o : ghc/ArrBase.mc_hi
+glaExts/ST.p_o : ghc/ArrBase.p_hi
+glaExts/ST.t_o : ghc/ArrBase.t_hi
+glaExts/ST.o : ghc/Unsafe.hi
+glaExts/ST.mc_o : ghc/Unsafe.mc_hi
+glaExts/ST.p_o : ghc/Unsafe.p_hi
+glaExts/ST.t_o : ghc/Unsafe.t_hi
 glaExts/ST.o : ghc/STBase.hi
-glaExts/ST.mc.o : ghc/STBase.mc.hi
-glaExts/ST.norm.o : ghc/STBase.norm.hi
-glaExts/ST.p.o : ghc/STBase.p.hi
+glaExts/ST.mc_o : ghc/STBase.mc_hi
+glaExts/ST.p_o : ghc/STBase.p_hi
+glaExts/ST.t_o : ghc/STBase.t_hi
 glaExts/ST.o : ghc/PrelBase.hi
-glaExts/ST.mc.o : ghc/PrelBase.mc.hi
-glaExts/ST.norm.o : ghc/PrelBase.norm.hi
-glaExts/ST.p.o : ghc/PrelBase.p.hi
-glaExts/ST.o : ghc/GHC.hi
-glaExts/ST.mc.o : ghc/GHC.mc.hi
-glaExts/ST.norm.o : ghc/GHC.norm.hi
-glaExts/ST.p.o : ghc/GHC.p.hi
-concurrent/Channel.o : concurrent/Channel.lhs
-concurrent/Channel.mc.o : concurrent/Channel.lhs
-concurrent/Channel.norm.o : concurrent/Channel.lhs
-concurrent/Channel.p.o : concurrent/Channel.lhs
-concurrent/ChannelVar.o : concurrent/ChannelVar.lhs
-concurrent/ChannelVar.mc.o : concurrent/ChannelVar.lhs
-concurrent/ChannelVar.norm.o : concurrent/ChannelVar.lhs
-concurrent/ChannelVar.p.o : concurrent/ChannelVar.lhs
-concurrent/Concurrent.o : concurrent/Concurrent.lhs
-concurrent/Concurrent.mc.o : concurrent/Concurrent.lhs
-concurrent/Concurrent.norm.o : concurrent/Concurrent.lhs
-concurrent/Concurrent.p.o : concurrent/Concurrent.lhs
-concurrent/Concurrent.o : required/IO.hi
-concurrent/Concurrent.mc.o : required/IO.mc.hi
-concurrent/Concurrent.norm.o : required/IO.norm.hi
-concurrent/Concurrent.p.o : required/IO.p.hi
+glaExts/ST.mc_o : ghc/PrelBase.mc_hi
+glaExts/ST.p_o : ghc/PrelBase.p_hi
+glaExts/ST.t_o : ghc/PrelBase.t_hi
+glaExts/ST.o : required/Monad.hi
+glaExts/ST.mc_o : required/Monad.mc_hi
+glaExts/ST.p_o : required/Monad.p_hi
+glaExts/ST.t_o : required/Monad.t_hi
+glaExts/ST.o : required/Ix.hi
+glaExts/ST.mc_o : required/Ix.mc_hi
+glaExts/ST.p_o : required/Ix.p_hi
+glaExts/ST.t_o : required/Ix.t_hi
+glaExts/Word.o glaExts/Word.mc_o glaExts/Word.p_o glaExts/Word.t_o : glaExts/Word.lhs
+glaExts/Word.o : ghc/PrelBase.hi
+glaExts/Word.mc_o : ghc/PrelBase.mc_hi
+glaExts/Word.p_o : ghc/PrelBase.p_hi
+glaExts/Word.t_o : ghc/PrelBase.t_hi
+glaExts/Word.o : ghc/PrelNum.hi
+glaExts/Word.mc_o : ghc/PrelNum.mc_hi
+glaExts/Word.p_o : ghc/PrelNum.p_hi
+glaExts/Word.t_o : ghc/PrelNum.t_hi
+glaExts/Word.o : ghc/PrelRead.hi
+glaExts/Word.mc_o : ghc/PrelRead.mc_hi
+glaExts/Word.p_o : ghc/PrelRead.p_hi
+glaExts/Word.t_o : ghc/PrelRead.t_hi
+glaExts/Word.o : required/Ix.hi
+glaExts/Word.mc_o : required/Ix.mc_hi
+glaExts/Word.p_o : required/Ix.p_hi
+glaExts/Word.t_o : required/Ix.t_hi
+glaExts/Word.o : ghc/Error.hi
+glaExts/Word.mc_o : ghc/Error.mc_hi
+glaExts/Word.p_o : ghc/Error.p_hi
+glaExts/Word.t_o : ghc/Error.t_hi
+glaExts/Word.o : glaExts/Bits.hi
+glaExts/Word.mc_o : glaExts/Bits.mc_hi
+glaExts/Word.p_o : glaExts/Bits.p_hi
+glaExts/Word.t_o : glaExts/Bits.t_hi
+glaExts/Word.o : ghc/GHC.hi
+glaExts/Word.mc_o : ghc/GHC.mc_hi
+glaExts/Word.p_o : ghc/GHC.p_hi
+glaExts/Word.t_o : ghc/GHC.t_hi
+concurrent/Channel.o concurrent/Channel.mc_o concurrent/Channel.p_o concurrent/Channel.t_o : concurrent/Channel.lhs
+concurrent/Channel.o : required/Prelude.hi
+concurrent/Channel.mc_o : required/Prelude.mc_hi
+concurrent/Channel.p_o : required/Prelude.p_hi
+concurrent/Channel.t_o : required/Prelude.t_hi
+concurrent/Channel.o : ghc/IOBase.hi
+concurrent/Channel.mc_o : ghc/IOBase.mc_hi
+concurrent/Channel.p_o : ghc/IOBase.p_hi
+concurrent/Channel.t_o : ghc/IOBase.t_hi
+concurrent/Channel.o : ghc/ConcBase.hi
+concurrent/Channel.mc_o : ghc/ConcBase.mc_hi
+concurrent/Channel.p_o : ghc/ConcBase.p_hi
+concurrent/Channel.t_o : ghc/ConcBase.t_hi
+concurrent/Channel.o : ghc/STBase.hi
+concurrent/Channel.mc_o : ghc/STBase.mc_hi
+concurrent/Channel.p_o : ghc/STBase.p_hi
+concurrent/Channel.t_o : ghc/STBase.t_hi
+concurrent/Channel.o : ghc/Unsafe.hi
+concurrent/Channel.mc_o : ghc/Unsafe.mc_hi
+concurrent/Channel.p_o : ghc/Unsafe.p_hi
+concurrent/Channel.t_o : ghc/Unsafe.t_hi
+concurrent/ChannelVar.o concurrent/ChannelVar.mc_o concurrent/ChannelVar.p_o concurrent/ChannelVar.t_o : concurrent/ChannelVar.lhs
+concurrent/ChannelVar.o : required/Prelude.hi
+concurrent/ChannelVar.mc_o : required/Prelude.mc_hi
+concurrent/ChannelVar.p_o : required/Prelude.p_hi
+concurrent/ChannelVar.t_o : required/Prelude.t_hi
+concurrent/ChannelVar.o : ghc/ConcBase.hi
+concurrent/ChannelVar.mc_o : ghc/ConcBase.mc_hi
+concurrent/ChannelVar.p_o : ghc/ConcBase.p_hi
+concurrent/ChannelVar.t_o : ghc/ConcBase.t_hi
+concurrent/Concurrent.o concurrent/Concurrent.mc_o concurrent/Concurrent.p_o concurrent/Concurrent.t_o : concurrent/Concurrent.lhs
 concurrent/Concurrent.o : concurrent/Parallel.hi
-concurrent/Concurrent.mc.o : concurrent/Parallel.mc.hi
-concurrent/Concurrent.norm.o : concurrent/Parallel.norm.hi
-concurrent/Concurrent.p.o : concurrent/Parallel.p.hi
+concurrent/Concurrent.mc_o : concurrent/Parallel.mc_hi
+concurrent/Concurrent.p_o : concurrent/Parallel.p_hi
+concurrent/Concurrent.t_o : concurrent/Parallel.t_hi
 concurrent/Concurrent.o : concurrent/ChannelVar.hi
-concurrent/Concurrent.mc.o : concurrent/ChannelVar.mc.hi
-concurrent/Concurrent.norm.o : concurrent/ChannelVar.norm.hi
-concurrent/Concurrent.p.o : concurrent/ChannelVar.p.hi
+concurrent/Concurrent.mc_o : concurrent/ChannelVar.mc_hi
+concurrent/Concurrent.p_o : concurrent/ChannelVar.p_hi
+concurrent/Concurrent.t_o : concurrent/ChannelVar.t_hi
 concurrent/Concurrent.o : concurrent/Channel.hi
-concurrent/Concurrent.mc.o : concurrent/Channel.mc.hi
-concurrent/Concurrent.norm.o : concurrent/Channel.norm.hi
-concurrent/Concurrent.p.o : concurrent/Channel.p.hi
+concurrent/Concurrent.mc_o : concurrent/Channel.mc_hi
+concurrent/Concurrent.p_o : concurrent/Channel.p_hi
+concurrent/Concurrent.t_o : concurrent/Channel.t_hi
 concurrent/Concurrent.o : concurrent/Semaphore.hi
-concurrent/Concurrent.mc.o : concurrent/Semaphore.mc.hi
-concurrent/Concurrent.norm.o : concurrent/Semaphore.norm.hi
-concurrent/Concurrent.p.o : concurrent/Semaphore.p.hi
+concurrent/Concurrent.mc_o : concurrent/Semaphore.mc_hi
+concurrent/Concurrent.p_o : concurrent/Semaphore.p_hi
+concurrent/Concurrent.t_o : concurrent/Semaphore.t_hi
 concurrent/Concurrent.o : concurrent/Merge.hi
-concurrent/Concurrent.mc.o : concurrent/Merge.mc.hi
-concurrent/Concurrent.norm.o : concurrent/Merge.norm.hi
-concurrent/Concurrent.p.o : concurrent/Merge.p.hi
+concurrent/Concurrent.mc_o : concurrent/Merge.mc_hi
+concurrent/Concurrent.p_o : concurrent/Merge.p_hi
+concurrent/Concurrent.t_o : concurrent/Merge.t_hi
 concurrent/Concurrent.o : concurrent/SampleVar.hi
-concurrent/Concurrent.mc.o : concurrent/SampleVar.mc.hi
-concurrent/Concurrent.norm.o : concurrent/SampleVar.norm.hi
-concurrent/Concurrent.p.o : concurrent/SampleVar.p.hi
+concurrent/Concurrent.mc_o : concurrent/SampleVar.mc_hi
+concurrent/Concurrent.p_o : concurrent/SampleVar.p_hi
+concurrent/Concurrent.t_o : concurrent/SampleVar.t_hi
 concurrent/Concurrent.o : ghc/ConcBase.hi
-concurrent/Concurrent.mc.o : ghc/ConcBase.mc.hi
-concurrent/Concurrent.norm.o : ghc/ConcBase.norm.hi
-concurrent/Concurrent.p.o : ghc/ConcBase.p.hi
-concurrent/Merge.o : concurrent/Merge.lhs
-concurrent/Merge.mc.o : concurrent/Merge.lhs
-concurrent/Merge.norm.o : concurrent/Merge.lhs
-concurrent/Merge.p.o : concurrent/Merge.lhs
+concurrent/Concurrent.mc_o : ghc/ConcBase.mc_hi
+concurrent/Concurrent.p_o : ghc/ConcBase.p_hi
+concurrent/Concurrent.t_o : ghc/ConcBase.t_hi
+concurrent/Merge.o concurrent/Merge.mc_o concurrent/Merge.p_o concurrent/Merge.t_o : concurrent/Merge.lhs
 concurrent/Merge.o : concurrent/Semaphore.hi
-concurrent/Merge.mc.o : concurrent/Semaphore.mc.hi
-concurrent/Merge.norm.o : concurrent/Semaphore.norm.hi
-concurrent/Merge.p.o : concurrent/Semaphore.p.hi
-concurrent/Parallel.o : concurrent/Parallel.lhs
-concurrent/Parallel.mc.o : concurrent/Parallel.lhs
-concurrent/Parallel.norm.o : concurrent/Parallel.lhs
-concurrent/Parallel.p.o : concurrent/Parallel.lhs
-concurrent/SampelVar.o : concurrent/SampelVar.lhs
-concurrent/SampelVar.mc.o : concurrent/SampelVar.lhs
-concurrent/SampelVar.norm.o : concurrent/SampelVar.lhs
-concurrent/SampelVar.p.o : concurrent/SampelVar.lhs
-concurrent/SampleVar.o : concurrent/SampleVar.lhs
-concurrent/SampleVar.mc.o : concurrent/SampleVar.lhs
-concurrent/SampleVar.norm.o : concurrent/SampleVar.lhs
-concurrent/SampleVar.p.o : concurrent/SampleVar.lhs
-concurrent/Semaphore.o : concurrent/Semaphore.lhs
-concurrent/Semaphore.mc.o : concurrent/Semaphore.lhs
-concurrent/Semaphore.norm.o : concurrent/Semaphore.lhs
-concurrent/Semaphore.p.o : concurrent/Semaphore.lhs
+concurrent/Merge.mc_o : concurrent/Semaphore.mc_hi
+concurrent/Merge.p_o : concurrent/Semaphore.p_hi
+concurrent/Merge.t_o : concurrent/Semaphore.t_hi
+concurrent/Merge.o : ghc/ConcBase.hi
+concurrent/Merge.mc_o : ghc/ConcBase.mc_hi
+concurrent/Merge.p_o : ghc/ConcBase.p_hi
+concurrent/Merge.t_o : ghc/ConcBase.t_hi
+concurrent/Merge.o : ghc/Unsafe.hi
+concurrent/Merge.mc_o : ghc/Unsafe.mc_hi
+concurrent/Merge.p_o : ghc/Unsafe.p_hi
+concurrent/Merge.t_o : ghc/Unsafe.t_hi
+concurrent/Merge.o : ghc/IOBase.hi
+concurrent/Merge.mc_o : ghc/IOBase.mc_hi
+concurrent/Merge.p_o : ghc/IOBase.p_hi
+concurrent/Merge.t_o : ghc/IOBase.t_hi
+concurrent/Parallel.o concurrent/Parallel.mc_o concurrent/Parallel.p_o concurrent/Parallel.t_o : concurrent/Parallel.lhs
+concurrent/Parallel.o : ghc/ConcBase.hi
+concurrent/Parallel.mc_o : ghc/ConcBase.mc_hi
+concurrent/Parallel.p_o : ghc/ConcBase.p_hi
+concurrent/Parallel.t_o : ghc/ConcBase.t_hi
+concurrent/SampleVar.o concurrent/SampleVar.mc_o concurrent/SampleVar.p_o concurrent/SampleVar.t_o : concurrent/SampleVar.lhs
+concurrent/SampleVar.o : ghc/ConcBase.hi
+concurrent/SampleVar.mc_o : ghc/ConcBase.mc_hi
+concurrent/SampleVar.p_o : ghc/ConcBase.p_hi
+concurrent/SampleVar.t_o : ghc/ConcBase.t_hi
+concurrent/Semaphore.o concurrent/Semaphore.mc_o concurrent/Semaphore.p_o concurrent/Semaphore.t_o : concurrent/Semaphore.lhs
+concurrent/Semaphore.o : ghc/ConcBase.hi
+concurrent/Semaphore.mc_o : ghc/ConcBase.mc_hi
+concurrent/Semaphore.p_o : ghc/ConcBase.p_hi
+concurrent/Semaphore.t_o : ghc/ConcBase.t_hi
 # DO NOT DELETE: End of Haskell dependencies
index 7bf6d18..6700907 100644 (file)
@@ -15,13 +15,13 @@ module Channel
        newChan,         -- :: IO (Chan a)
 
         {- operators -}
-       putChan,         -- :: Chan a -> a -> IO ()
-       getChan,         -- :: Chan a -> IO a
+       writeChan,       -- :: Chan a -> a -> IO ()
+       readChan,        -- :: Chan a -> IO a
        dupChan,         -- :: Chan a -> IO (Chan a)
        unGetChan,       -- :: Chan a -> a -> IO ()
 
         {- stream interface -}
-       getChanContents, -- :: Chan a -> IO [a]
+       readChanContents, -- :: Chan a -> IO [a]
        putList2Chan     -- :: Chan a -> [a] -> IO ()
 
        ) where
@@ -30,7 +30,7 @@ import Prelude
 import IOBase  ( IO(..), ioToST, stToIO )              -- Suspicious!
 import ConcBase
 import STBase
-import UnsafeST ( unsafeInterleavePrimIO )
+import Unsafe ( unsafeInterleaveIO )
 \end{code}
 
 A channel is represented by two @MVar@s keeping track of the two ends
@@ -74,8 +74,8 @@ new hole.
 
 \begin{code}
 
-putChan :: Chan a -> a -> IO ()
-putChan (Chan read write) val
+writeChan :: Chan a -> a -> IO ()
+writeChan (Chan read write) val
  = newEmptyMVar                    >>= \ new_hole ->
    takeMVar write          >>= \ old_hole ->
    putMVar write new_hole   >> 
@@ -83,8 +83,8 @@ putChan (Chan read write) val
    return ()
 
 
-getChan :: Chan a -> IO a
-getChan (Chan read write)
+readChan :: Chan a -> IO a
+readChan (Chan read write)
  = takeMVar read         >>= \ rend ->
    takeMVar rend          >>= \ (ChItem val new_rend) ->
    putMVar read new_rend  >>
@@ -112,18 +112,16 @@ Operators for interfacing with functional streams.
 
 \begin{code}
 
-getChanContents :: Chan a -> IO [a]
-getChanContents ch
+readChanContents :: Chan a -> IO [a]
+readChanContents ch
   = unsafeInterleaveIO (do
-       x <- getChan ch
-       xs <- getChanContents ch
+       x <- readChan ch
+       xs <- readChanContents ch
        return (x:xs)
     )
 
-unsafeInterleaveIO = stToIO . unsafeInterleavePrimIO . ioToST
-
 -------------
 putList2Chan :: Chan a -> [a] -> IO ()
-putList2Chan ch ls = sequence (map (putChan ch) ls)
+putList2Chan ch ls = sequence (map (writeChan ch) ls)
 
 \end{code}
index ee21c87..a60b830 100644 (file)
@@ -12,8 +12,8 @@ module ChannelVar
         {- abstract -}
          CVar,
         newCVar,       --:: IO (CVar a)
-        putCVar,       --:: CVar a -> a -> IO ()
-        getCVar,       --:: CVar a -> IO a
+        writeCVar,     --:: CVar a -> a -> IO ()
+        readCVar,      --:: CVar a -> IO a
         MVar
 
        ) where
@@ -35,20 +35,20 @@ data CVar a
         (MVar ())    -- cons -> prod
 
 newCVar :: IO (CVar a)
-putCVar :: CVar a -> a -> IO ()
-getCVar :: CVar a -> IO a
+writeCVar :: CVar a -> a -> IO ()
+readCVar :: CVar a -> IO a
 
 newCVar 
  = newEmptyMVar >>= \ datum ->
    newMVar ()   >>= \ ack ->
    return (CVar datum ack)
 
-putCVar (CVar datum ack) val
+writeCVar (CVar datum ack) val
  = takeMVar ack      >> 
    putMVar datum val >>
    return ()
 
-getCVar (CVar datum ack)
+readCVar (CVar datum ack)
  = takeMVar datum >>= \ val ->
    putMVar ack () >> 
    return val
index 3f79413..a108a24 100644 (file)
@@ -16,7 +16,7 @@ module Merge
 
 import Semaphore
 import ConcBase
-import UnsafeST  ( unsafeInterleavePrimIO )
+import Unsafe  ( unsafeInterleaveIO )
 import IOBase
 
 max_buff_size = 1
@@ -63,10 +63,10 @@ suckIO branches_running buff@(tail_list,e) vs
                waitQSem e                       >>
                takeMVar tail_list               >>= \ node ->
                newEmptyMVar                     >>= \ next_node ->
-               unsafeInterleavePrimIO ( ioToPrimIO $
+               unsafeInterleaveIO (
                        takeMVar next_node  >>= \ x ->
                        signalQSem e        >>
-                       return x)           `thenIO_Prim` \ next_node_val ->
+                       return x)                >>= \ next_node_val ->
                putMVar node (x:next_node_val)   >>
                putMVar tail_list next_node      >>
                suckIO branches_running buff xs
index 2897567..0854a29 100644 (file)
@@ -21,10 +21,11 @@ module SampleVar
        (
          SampleVar,        --:: type _ =
  
-         newSampleVar,     --:: IO (SampleVar a)
-        emptySampleVar,   --:: SampleVar a -> IO ()
-        readSample,       --:: SampleVar a -> IO a
-        writeSample       --:: SampleVar a -> a -> IO ()
+        newEmptySampleVar, --:: IO (SampleVar a)
+         newSampleVar,      --:: a -> IO (SampleVar a)
+        emptySampleVar,    --:: SampleVar a -> IO ()
+        readSample,        --:: SampleVar a -> IO a
+        writeSample        --:: SampleVar a -> a -> IO ()
 
        ) where
 
@@ -39,17 +40,23 @@ type SampleVar a
 
 -- Initally, a @SampleVar@ is empty/unfilled.
 
-newSampleVar :: IO (SampleVar a)
-newSampleVar
- = newEmptyMVar          >>= \ val ->
-   newMVar (0,val)
+newEmptySampleVar :: IO (SampleVar a)
+newEmptySampleVar = do
+   v <- newEmptyMVar
+   newMVar (0,v)
+
+newSampleVar :: a -> IO (SampleVar a)
+newSampleVar a = do
+   v <- newEmptyMVar
+   putMVar v a
+   newMVar (1,v)
 
 emptySampleVar :: SampleVar a -> IO ()
-emptySampleVar v
- = takeMVar v         >>= \ (readers,var) ->
+emptySampleVar v = do
+   (readers, var) <- takeMVar v
    if readers >= 0 then
      putMVar v (0,var)
-   else
+    else
      putMVar v (readers,var)
 
 --
@@ -57,9 +64,9 @@ emptySampleVar v
 -- not filled => try to grab value, empty when read val.
 --
 readSample :: SampleVar a -> IO a
-readSample svar
- = takeMVar svar                >>= \ (readers,val) ->
-   putMVar svar (readers-1,val) >>
+readSample svar = do
+   (readers,val) <- takeMVar svar
+   putMVar svar (readers-1,val)
    takeMVar val
 
 --
@@ -67,11 +74,11 @@ readSample svar
 -- not filled => fill, write val
 --
 writeSample :: SampleVar a -> a -> IO ()
-writeSample svar v
- = takeMVar svar  >>= \ (readers, val) ->
+writeSample svar v = do
+   (readers,val) <- takeMVar svar
    case readers of
      1 -> 
-       swapMVar val v      >> 
+       swapMVar val v >> 
        putMVar svar (1,val)
      _ -> 
        putMVar val v >> 
index c736fed..4ab72b8 100644 (file)
@@ -11,12 +11,13 @@ types and operations.
 
 module ArrBase where
 
-import {-# SOURCE #-}  IOBase  ( error )
+import {-# SOURCE #-} Error ( error )
 import Ix
 import PrelList (foldl)
 import STBase
 import PrelBase
-import Foreign
+import CCall
+import Addr
 import GHC
 
 infixl 9  !, //
@@ -64,8 +65,42 @@ instance CCallable ByteArray#
 
 -- A one-element mutable array:
 type MutableVar s a = MutableArray s Int a
+
+-- just pointer equality on arrays:
+instance Eq (MutableArray s ix elt) where
+       MutableArray _ arr1# == MutableArray _ arr2# 
+               = sameMutableArray# arr1# arr2#
+
+instance Eq (MutableByteArray s ix) where
+       MutableByteArray _ arr1# == MutableByteArray _ arr2#
+               = sameMutableByteArray# arr1# arr2#
 \end{code}
 
+%*********************************************************
+%*                                                     *
+\subsection{Operations on mutable variables}
+%*                                                     *
+%*********************************************************
+
+\begin{code}
+newVar   :: a -> ST s (MutableVar s a)
+readVar  :: MutableVar s a -> ST s a
+writeVar :: MutableVar s a -> a -> ST s ()
+
+newVar init = ST $ \ s# ->
+    case (newArray# 1# init s#)     of { StateAndMutableArray# s2# arr# ->
+    STret s2# (MutableArray vAR_IXS arr#) }
+  where
+    vAR_IXS = error "newVar: Shouldn't access `bounds' of a MutableVar\n"
+
+readVar (MutableArray _ var#) = ST $ \ s# ->
+    case readArray# var# 0# s# of { StateAndPtr# s2# r ->
+    STret s2# r }
+
+writeVar (MutableArray _ var#) val = ST $ \ s# ->
+    case writeArray# var# 0# val s# of { s2# ->
+    STret s2# () }
+\end{code}
 
 %*********************************************************
 %*                                                     *
@@ -107,20 +142,20 @@ arrEleBottom = error "(Array.!): undefined array element"
 
 fill_it_in :: Ix ix => MutableArray s ix elt -> [(ix, elt)] -> ST s ()
 fill_it_in arr lst
-  = foldr fill_one_in (returnST ()) lst
+  = foldr fill_one_in (return ()) lst
   where  -- **** STRICT **** (but that's OK...)
     fill_one_in (i, v) rst
-      = writeArray arr i v `seqST` rst
+      = writeArray arr i v >> rst
 
 -----------------------------------------------------------------------
 -- these also go better with magic: (//), accum, accumArray
 
 old_array // ivs
-  = runST (
+  = runST (do
        -- copy the old array:
-       thawArray old_array                 `thenST` \ arr ->   
+       arr <- thawArray old_array
        -- now write the new elements into the new array:
-       fill_it_in arr ivs                  `seqST`
+       fill_it_in arr ivs
        freezeArray arr
     )
   where
@@ -130,29 +165,28 @@ zap_with_f :: Ix ix => (elt -> elt2 -> elt) -> MutableArray s ix elt -> [(ix,elt
 -- zap_with_f: reads an elem out first, then uses "f" on that and the new value
 
 zap_with_f f arr lst
-  = foldr zap_one (returnST ()) lst
+  = foldr zap_one (return ()) lst
   where
-    zap_one (i, new_v) rst
-      = readArray  arr i                `thenST`  \ old_v ->
-       writeArray arr i (f old_v new_v) `seqST`
+    zap_one (i, new_v) rst = do
+        old_v <- readArray  arr i
+       writeArray arr i (f old_v new_v)
        rst
 
 accum f old_array ivs
-  = runST (
+  = runST (do
        -- copy the old array:
-       thawArray old_array                 `thenST` \ arr ->   
-
+       arr <- thawArray old_array
        -- now zap the elements in question with "f":
-       zap_with_f f arr ivs            >>
+       zap_with_f f arr ivs
        freezeArray arr
     )
   where
     bottom = error "Array.accum: error in copying old array\n"
 
 accumArray f zero ixs ivs
-  = runST (
-       newArray ixs zero       >>= \ arr# ->
-       zap_with_f f  arr# ivs  >>
+  = runST (do
+       arr# <- newArray ixs zero
+       zap_with_f f  arr# ivs
        freezeArray arr#
     )
 \end{code}
index 81f2724..96ebe29 100644 (file)
@@ -11,7 +11,6 @@ Basic concurrency stuff
 module ConcBase(
                -- Forking and suchlike
        ST,     forkST,
-       PrimIO, forkPrimIO,
        IO,     forkIO, 
        par, fork,
        threadDelay, threadWaitRead, threadWaitWrite,
@@ -21,7 +20,7 @@ module ConcBase(
     ) where
 
 import PrelBase
-import STBase  ( PrimIO(..), ST(..), STret(..), StateAndPtr#(..) )
+import STBase  ( ST(..), STret(..), StateAndPtr#(..) )
 import IOBase  ( IO(..), IOResult(..), MVar(..) )
 import GHCerr  ( parError )
 import PrelBase        ( Int(..) )
@@ -48,9 +47,6 @@ forkST (ST action) = ST $ \ s ->
        let d@(STret _ r) = action s in
        d `fork` STret s r
 
-forkPrimIO :: PrimIO a -> PrimIO a
-forkPrimIO = forkST
-
 forkIO :: IO () -> IO ()
 forkIO (IO action) = IO $ \ s -> (action s) `fork` IOok s ()
 
@@ -71,11 +67,13 @@ fork x y = case (fork# x) of { 0# -> parError; _ -> y }
 fork x y = y
 #endif
 
+runOrBlockIO m = m                     -- ?????
+
 \end{code}
 
 %************************************************************************
 %*                                                                     *
-\subsection[PreludeGlaST-mvars]{M-Structures}
+\subsection[mvars]{M-Structures}
 %*                                                                     *
 %************************************************************************
 
diff --git a/ghc/lib/ghc/Error.hi-boot b/ghc/lib/ghc/Error.hi-boot
new file mode 100644 (file)
index 0000000..fe91b8a
--- /dev/null
@@ -0,0 +1,12 @@
+---------------------------------------------------------------------------
+--                              Error.hi-boot
+-- 
+--      This hand-written interface file is the initial bootstrap version
+--     for Error.hi.
+--     It doesn't need to give "error" a type signature, 
+--     because it's wired into the compiler
+---------------------------------------------------------------------------
+_interface_ Error 1
+_exports_
+Error error;
diff --git a/ghc/lib/ghc/Error.lhs b/ghc/lib/ghc/Error.lhs
new file mode 100644 (file)
index 0000000..1d62ce6
--- /dev/null
@@ -0,0 +1,68 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[Error]{Module @Error@}
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module Error (errorIO, error) where
+
+import PrelBase
+import IOBase
+import Foreign
+import Addr
+\end{code}
+
+%*********************************************************
+%*                                                     *
+\subsection{Error-ish functions}
+%*                                                     *
+%*********************************************************
+
+\begin{code}
+errorIO :: IO () -> a
+
+errorIO (IO io)
+  = case (errorIO# io) of
+      _ -> bottom
+  where
+    bottom = bottom -- Never evaluated
+
+--errorIO x = (waitRead#, errorIO#, makeForeignObj#, waitWrite#, (+#))
+
+-- error stops execution and displays an error message
+error :: String -> a
+error s = error__ ( \ x -> _ccall_ ErrorHdrHook x ) s
+
+error__ :: (Addr{-FILE *-} -> IO ()) -> String -> a
+
+error__ msg_hdr s
+#ifdef __PARALLEL_HASKELL__
+  = errorIO (msg_hdr sTDERR{-msg hdr-} >>
+            _ccall_ fflush sTDERR      >>
+            fputs sTDERR s             >>
+            _ccall_ fflush sTDERR      >>
+            _ccall_ stg_exit (1::Int)
+           )
+#else
+  = errorIO (msg_hdr sTDERR{-msg hdr-} >>
+            _ccall_ fflush sTDERR      >>
+            fputs sTDERR s             >>
+            _ccall_ fflush sTDERR      >>
+            _ccall_ getErrorHandler    >>= \ errorHandler ->
+            if errorHandler == (-1::Int) then
+               _ccall_ stg_exit (1::Int)
+            else
+               _casm_ ``%r = (StgStablePtr)(%0);'' errorHandler
+                                               >>= \ osptr ->
+               _ccall_ decrementErrorCount     >>= \ () ->
+               deRefStablePtr osptr            >>= \ oact ->
+               oact
+           )
+#endif {- !parallel -}
+  where
+    sTDERR = (``stderr'' :: Addr)
+\end{code}
+
index 4f563db..3abdbd9 100644 (file)
@@ -77,6 +77,7 @@ GHC
   and#
   or#
   not#
+  xor#
   shiftL#
   shiftRA#
   shiftRL#
index 8841461..ee5643b 100644 (file)
@@ -18,7 +18,7 @@ module GHCerr where
 --import Prelude
 import PrelBase
 import PrelList ( span )
-import IOBase
+import Error
 
 ---------------------------------------------------------------
 -- HACK: Magic unfoldings not implemented for unboxed lists
index a030899..0a67a1d 100644 (file)
@@ -1,32 +1,19 @@
-\section[GHCmain]{Module @GHCmain@}
+%
+% (c) The AQUA Project, Glasgow University, 1994-1997
+%
 
-This is the mainPrimIO that must be used for Haskell~1.3.
+\section[GHCmain]{Module @GHCmain@}
 
 \begin{code}
-module GHCmain( mainPrimIO ) where
+module GHCmain( mainIO ) where
 
 import Prelude
 import {-# SOURCE #-} qualified Main   -- for type of "Main.main"
-import IOBase
-import STBase
 \end{code}
 
 \begin{code}
-mainPrimIO = ST $ \ s ->
-    case Main.main   of { IO main_guts ->
-    case main_guts s of
-       IOok   s2 ()  -> STret s2 ()
-       IOfail s2 err -> error ("I/O error: "++showsPrec 0 err "\n")
-    }
+mainIO :: IO ()                -- It must be of type (IO t) because that's what
+                       -- the RTS expects.  GHC doesn't check this, so
+                       -- make sure this type signature stays!
+mainIO = catch Main.main (\err -> error ("I/O error: "++showsPrec 0 err "\n"))
 \end{code}
-
-OLD COMMENT:
-
-Nota Bene!  @mainIO@ is written as an explicit function, rather than
-by saying: @mainIO = requestToIO main@ so that the code generator
-recognises @mainIO@ as a {\em function} (hence HNF, hence not
-updatable), rather than a zero-arity CAF (hence updatable).  If it is
-updated, then we have a mega-space leak, because the entire action
-(@requestToIO main@) is retained indefinitely.
-
-(This doesn't waste work because @mainIO@ is only used once.)
index 9121dfc..d6253db 100644 (file)
@@ -13,18 +13,16 @@ concretely; the @IO@ module itself exports abstractly.
 
 module IOBase where
 
+import {-# SOURCE #-} Error
 import STBase
-import UnsafeST
 import PrelTup
-import Foreign
+import Addr
 import PackBase        ( unpackCString )
 import PrelBase
 import ArrBase ( ByteArray(..), MutableVar(..) )
-import PrelRead
 
 import GHC
 
-infixr 1 `thenIO_Prim`, `seqIO_Prim`
 \end{code}
 
 %*********************************************************
@@ -33,10 +31,10 @@ infixr 1 `thenIO_Prim`, `seqIO_Prim`
 %*                                                     *
 %*********************************************************
 
-IO is no longer built on top of PrimIO (which is a specialised version
-of the ST monad), instead it is now has its own type.  This is purely
-for efficiency purposes, since we get to remove several levels of
-lifting in the type of the monad.
+IO is no longer built on top of PrimIO (which used to be a specialised
+version of the ST monad), instead it is now has its own type.  This is
+purely for efficiency purposes, since we get to remove several levels
+of lifting in the type of the monad.
 
 \begin{code}
 newtype IO a = IO (State# RealWorld -> IOResult a)
@@ -93,18 +91,13 @@ instance  Show (IO a)  where
 
 %*********************************************************
 %*                                                     *
-\subsection{Coercions to @ST@ and @PrimIO@}
+\subsection{Coercions to @ST@}
 %*                                                     *
 %*********************************************************
 
 \begin{code}
 stToIO    :: ST RealWorld a -> IO a
-primIOToIO :: PrimIO a       -> IO a
 ioToST    :: IO a -> ST RealWorld a
-ioToPrimIO :: IO a -> PrimIO       a
-
-primIOToIO = stToIO -- for backwards compatibility
-ioToPrimIO = ioToST
 
 stToIO (ST m) = IO $ \ s -> case (m s) of STret new_s r -> IOok new_s r
 
@@ -114,87 +107,6 @@ ioToST (IO io) = ST $ \ s ->
       IOfail new_s e -> error ("I/O Error (ioToST): " ++ showsPrec 0 e "\n")
 \end{code}
 
-@thenIO_Prim@ is a useful little number for doing _ccall_s in IO-land:
-
-\begin{code}
-thenIO_Prim :: PrimIO a -> (a -> IO b) -> IO b
-seqIO_Prim  :: PrimIO a -> IO b -> IO b
-{-# INLINE thenIO_Prim   #-}
-{-# INLINE seqIO_Prim   #-}
-
-thenIO_Prim (ST m) k = IO $ \ s ->
-    case (m s) of STret new_s m_res -> unIO (k m_res) new_s
-
-seqIO_Prim m k = thenIO_Prim m (\ _ -> k)
-\end{code}
-
-
-%*********************************************************
-%*                                                     *
-\subsection{Error/trace-ish functions}
-%*                                                     *
-%*********************************************************
-
-\begin{code}
-errorIO :: PrimIO () -> a
-
-errorIO (ST io)
-  = case (errorIO# io) of
-      _ -> bottom
-  where
-    bottom = bottom -- Never evaluated
-
---errorIO x = (waitRead#, errorIO#, makeForeignObj#, waitWrite#, (+#))
-
--- error stops execution and displays an error message
-error :: String -> a
-error s = error__ ( \ x -> _ccall_ ErrorHdrHook x ) s
-
-error__ :: (Addr{-FILE *-} -> PrimIO ()) -> String -> a
-
-error__ msg_hdr s
-#ifdef __PARALLEL_HASKELL__
-  = errorIO (msg_hdr sTDERR{-msg hdr-} >>
-            _ccall_ fflush sTDERR      >>
-            fputs sTDERR s             >>
-            _ccall_ fflush sTDERR      >>
-            _ccall_ stg_exit (1::Int)
-           )
-#else
-  = errorIO (msg_hdr sTDERR{-msg hdr-} >>
-            _ccall_ fflush sTDERR      >>
-            fputs sTDERR s             >>
-            _ccall_ fflush sTDERR      >>
-            _ccall_ getErrorHandler    >>= \ errorHandler ->
-            if errorHandler == (-1::Int) then
-               _ccall_ stg_exit (1::Int)
-            else
-               _casm_ ``%r = (StgStablePtr)(%0);'' errorHandler
-                                               >>= \ osptr ->
-               _ccall_ decrementErrorCount     >>= \ () ->
-               deRefStablePtr osptr            >>= \ oact ->
-               oact
-           )
-#endif {- !parallel -}
-  where
-    sTDERR = (``stderr'' :: Addr)
-\end{code}
-
-\begin{code}
-{-# GENERATE_SPECS _trace a #-}
-trace :: String -> a -> a
-
-trace string expr
-  = unsafePerformPrimIO (
-       ((_ccall_ PreTraceHook sTDERR{-msg-}):: PrimIO ())  >>
-       fputs sTDERR string                                 >>
-       ((_ccall_ PostTraceHook sTDERR{-msg-}):: PrimIO ()) >>
-       returnPrimIO expr )
-  where
-    sTDERR = (``stderr'' :: Addr)
-\end{code}
-
-
 %*********************************************************
 %*                                                     *
 \subsection{Utility functions}
@@ -204,7 +116,7 @@ trace string expr
 I'm not sure why this little function is here...
 
 \begin{code}
-fputs :: Addr{-FILE*-} -> String -> PrimIO Bool
+fputs :: Addr{-FILE*-} -> String -> IO Bool
 
 fputs stream [] = return True
 
@@ -313,7 +225,7 @@ SOF & 4/96 & added argument to indicate function that flagged error
 \begin{code}
 constructErrorAndFail :: String -> IO a
 constructErrorAndFail call_site
-  = stToIO (constructError call_site) >>= \ io_error ->
+  = constructError call_site >>= \ io_error ->
     fail io_error
 
 \end{code}
@@ -331,7 +243,7 @@ to a value that is one of the \tr{#define}s in @includes/error.h@.
 information.
 
 \begin{code}
-constructError       :: String -> PrimIO IOError
+constructError       :: String -> IO IOError
 constructError call_site =
  _casm_ ``%r = ghc_errtype;''    >>= \ (I# errtype#) ->
  _casm_ ``%r = ghc_errstr;''    >>= \ str ->
@@ -388,6 +300,11 @@ a handles reside in @IOHandle@.
 -}
 data MVar a = MVar (SynchVar# RealWorld a)
 
+{-
+  Double sigh - ForeignObj is needed here too to break a cycle.
+-}
+data ForeignObj = ForeignObj ForeignObj#   -- another one
+
 #if defined(__CONCURRENT_HASKELL__)
 type Handle = MVar Handle__
 #else
@@ -462,5 +379,10 @@ and terminals will normally be line-buffered.
 \begin{code}
 data BufferMode  
  = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
-   deriving (Eq, Ord, Read, Show)
+   deriving (Eq, Ord, {-ToDo: Read,-} Show)
+\end{code}
+
+\begin{code}
+performGC :: IO ()
+performGC = _ccall_GC_ StgPerformGarbageCollection
 \end{code}
index 72f1fae..0d1a9fb 100644 (file)
@@ -15,22 +15,22 @@ which are supported for them.
 module IOHandle where
 
 import ST
-import UnsafeST
 import STBase
-import ArrBase ( ByteArray(..) )
+import ArrBase ( ByteArray(..), newVar, readVar, writeVar )
 import PrelRead        ( Read )
 import PrelList (span)
 import Ix
 import IOBase
+import Unsafe   ( unsafePerformIO )
 import PrelTup
 import PrelBase
 import GHC
+import Addr
+import Error
 
-import Foreign  ( Addr, 
 #ifndef __PARALLEL_HASKELL__
-                  ForeignObj, makeForeignObj, writeForeignObj 
+import Foreign  ( ForeignObj, makeForeignObj, writeForeignObj )
 #endif
-                 )
 
 #if defined(__CONCURRENT_HASKELL__)
 import ConcBase
@@ -123,62 +123,50 @@ standard error channel. These handles are initially open.
 \begin{code}
 stdin, stdout, stderr :: Handle
 
-stdin = unsafePerformPrimIO (
-    _ccall_ getLock (``stdin''::Addr) 0                >>= \ rc ->
-    (case rc of
-       0 -> new_handle ClosedHandle
-       1 -> 
+stdin = unsafePerformIO (do
+    rc <- _ccall_ getLock (``stdin''::Addr) 0
+    case rc of
+       0 -> newHandle ClosedHandle
+       1 -> do
 #ifndef __PARALLEL_HASKELL__
-            makeForeignObj (``stdin''::Addr) (``&freeStdFile''::Addr) >>= \ fp ->
-           new_handle (ReadHandle fp Nothing False)
+            fp <- makeForeignObj (``stdin''::Addr) (``&freeStdFile''::Addr)
+           newHandle (ReadHandle fp Nothing False)
 #else
-           new_handle (ReadHandle ``stdin'' Nothing False)
+           newHandle (ReadHandle ``stdin'' Nothing False)
 #endif
-       _ -> constructError "stdin"             >>= \ ioError -> 
-            new_handle (ErrorHandle ioError)
-    )                                          >>= \ handle ->
-    returnPrimIO handle
+       _ -> do ioError <- constructError "stdin"
+               newHandle (ErrorHandle ioError)
   )
-  where
-    new_handle x = ioToST (newHandle x)
 
-stdout = unsafePerformPrimIO (
-    _ccall_ getLock (``stdout''::Addr) 1       >>= \ rc ->
-    (case rc of
-       0 -> new_handle ClosedHandle
-       1 -> 
+stdout = unsafePerformIO (do
+    rc <- _ccall_ getLock (``stdout''::Addr) 1
+    case rc of
+       0 -> newHandle ClosedHandle
+       1 -> do
 #ifndef __PARALLEL_HASKELL__
-            makeForeignObj (``stdout''::Addr) (``&freeStdFile''::Addr) >>= \ fp ->
-           new_handle (WriteHandle fp Nothing False)
+            fp <- makeForeignObj (``stdout''::Addr) (``&freeStdFile''::Addr)
+           newHandle (WriteHandle fp Nothing False)
 #else
-           new_handle (WriteHandle ``stdout'' Nothing False)
+           newHandle (WriteHandle ``stdout'' Nothing False)
 #endif
-       _ -> constructError "stdout"            >>= \ ioError -> 
-            new_handle (ErrorHandle ioError)
-    )                                          >>= \ handle ->
-    returnPrimIO handle
+       _ -> do ioError <- constructError "stdout"
+               newHandle (ErrorHandle ioError)
   )
-  where
-    new_handle x = ioToST (newHandle x)
 
-stderr = unsafePerformPrimIO (
-    _ccall_ getLock (``stderr''::Addr) 1       >>= \ rc ->
-    (case rc of
-       0 -> new_handle ClosedHandle
-       1 -> 
+stderr = unsafePerformIO (do
+    rc <- _ccall_ getLock (``stderr''::Addr) 1
+    case rc of
+       0 -> newHandle ClosedHandle
+       1 -> do
 #ifndef __PARALLEL_HASKELL__
-            makeForeignObj (``stderr''::Addr) (``&freeStdFile''::Addr) >>= \ fp ->
-            new_handle (WriteHandle fp (Just NoBuffering) False)       
+            fp <- makeForeignObj (``stderr''::Addr) (``&freeStdFile''::Addr)
+            newHandle (WriteHandle fp (Just NoBuffering) False)        
 #else
-            new_handle (WriteHandle ``stderr'' (Just NoBuffering) False)       
+            newHandle (WriteHandle ``stderr'' (Just NoBuffering) False)
 #endif
-       _ -> constructError "stderr"            >>= \ ioError -> 
-            new_handle (ErrorHandle ioError)
-    )                                          >>= \ handle ->
-    returnPrimIO handle
+       _ -> do ioError <- constructError "stderr"
+               newHandle (ErrorHandle ioError)
   )
-  where
-    new_handle x = ioToST (newHandle x)
 \end{code}
 
 %*********************************************************
@@ -193,17 +181,17 @@ data IOMode      =  ReadMode | WriteMode | AppendMode | ReadWriteMode
 
 openFile :: FilePath -> IOMode -> IO Handle
 
-openFile f m = 
-    stToIO (_ccall_ openFile f m')                          >>= \ ptr ->
-    if ptr /= ``NULL'' then
+openFile f m = do
+    ptr <- _ccall_ openFile f m'
+    if ptr /= ``NULL'' then do
 #ifndef __PARALLEL_HASKELL__
-        makeForeignObj ptr ((``&freeFile'')::Addr)   `thenIO_Prim` \ fp ->
-        newHandle (htype fp Nothing False)
+       fp <- makeForeignObj ptr ((``&freeFile'')::Addr)
+       newHandle (htype fp Nothing False)
 #else
-        newHandle (htype ptr Nothing False)
+       newHandle (htype ptr Nothing False)
 #endif
-    else
-       stToIO (constructError "openFile")          >>= \ ioError@(IOError hn iot msg) -> 
+      else do
+       ioError@(IOError hn iot msg) <- constructError "openFile"
        let
            improved_error -- a HACK, I guess
              = case iot of
@@ -211,7 +199,6 @@ openFile f m =
                  NoSuchThing      -> IOError hn NoSuchThing      (msg ++ ": " ++ f)
                  PermissionDenied -> IOError hn PermissionDenied (msg ++ ": " ++ f)
                  _                -> ioError
-       in
         fail improved_error
   where
     m' = case m of 
@@ -254,53 +241,55 @@ implementation is free to impose stricter conditions.
 \begin{code}
 hClose :: Handle -> IO ()
 
-hClose handle =
-    readHandle handle                              >>= \ htype ->
+hClose handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
          fail ioError
-      ClosedHandle -> 
-          writeHandle handle htype                 >>
+      ClosedHandle -> do
+          writeHandle handle htype
          ioe_closedHandle handle
-      SemiClosedHandle fp (buf,_) ->
-          (if buf /= ``NULL'' then
-             _ccall_ free buf
-           else                            
-              returnPrimIO ())                     `thenIO_Prim` \ () ->
-             _casm_ `` %r = (char *)%0; '' fp      `thenIO_Prim` \ fp_a ->
-              if fp_a /= (``NULL''::Addr) then -- Under what condition can this be NULL?
-                _ccall_ closeFile fp               `thenIO_Prim` \ rc ->
+      SemiClosedHandle fp (buf,_) -> do
+          (if buf /= ``NULL'' then 
+               _ccall_ free buf 
+          else 
+               return ())
+         fp_a <- _casm_ `` %r = (char *)%0; '' fp
+          if fp_a /= (``NULL''::Addr) then do 
+               -- Under what condition can this be NULL?
+                rc <- _ccall_ closeFile fp
                  {- We explicitly close a file object so that we can be told
                     if there were any errors. Note that after @hClose@
                     has been performed, the ForeignObj embedded in the Handle
                      is still lying around in the heap, so care is taken
                      to avoid closing the file object when the ForeignObj
                     is finalised.  -}
-                if rc == 0 then 
+                if rc == 0 then do
 #ifndef __PARALLEL_HASKELL__
-                 -- Mark the foreign object data value as gone to the finaliser (freeFile())
-                 writeForeignObj fp ``NULL''       `thenIO_Prim` \ () ->
+                 -- Mark the foreign object data value as 
+                 -- gone to the finaliser (freeFile())
+                 writeForeignObj fp ``NULL''
 #endif
                  writeHandle handle ClosedHandle
-                else
-                 writeHandle handle htype >>
+                 else do
+                 writeHandle handle htype
                  constructErrorAndFail "hClose"
 
-              else                         
-                  writeHandle handle htype
-      other -> 
-         let fp = filePtr other in
-          _ccall_ closeFile fp     `thenIO_Prim` \ rc ->
-          if rc == 0 then 
+            else  writeHandle handle htype
+
+      other -> do
+         let fp = filePtr other
+          rc <- _ccall_ closeFile fp
+          if rc == 0 then do
 #ifndef __PARALLEL_HASKELL__
-                 -- Mark the foreign object data
-                 writeForeignObj fp ``NULL''       `thenIO_Prim` \ () ->
+               -- Mark the foreign object data
+               writeForeignObj fp ``NULL''
 #endif
-             writeHandle handle ClosedHandle
-          else
-             writeHandle handle htype >>
-             constructErrorAndFail "hClose"
+               writeHandle handle ClosedHandle
+            else do
+               writeHandle handle htype
+               constructErrorAndFail "hClose"
 \end{code}
 
 Computation $hClose hdl$ makes handle {\em hdl} closed.  Before the
@@ -320,34 +309,36 @@ which can be read from {\em hdl}.
 
 \begin{code}
 hFileSize :: Handle -> IO Integer
-hFileSize handle =
-    readHandle handle                              >>= \ htype ->
+hFileSize handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                          >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
          fail ioError
-      ClosedHandle -> 
-         writeHandle handle htype                          >>
+      ClosedHandle -> do
+         writeHandle handle htype
          ioe_closedHandle handle
-      SemiClosedHandle _ _ -> 
-         writeHandle handle htype                          >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
          ioe_closedHandle handle
       other ->
           -- HACK!  We build a unique MP_INT of the right shape to hold
-          -- a single unsigned word, and we let the C routine change the data bits
-          _casm_ ``%r = 1;''                       `thenIO_Prim` \ (I# hack#) ->
+          -- a single unsigned word, and we let the C routine 
+         -- change the data bits
+         --
+         -- For some reason, this fails to typecheck if converted to a do
+         -- expression --SDM
+          _casm_ ``%r = 1;'' >>= \(I# hack#) ->
           case int2Integer# hack# of
-            result@(J# _ _ d#) ->
-               let
-                   bogus_bounds = (error "fileSize"::(Int,Int))
-               in
-                _ccall_ fileSize (filePtr other) (ByteArray bogus_bounds d#)
-                                                    `thenIO_Prim` \ rc ->
-               writeHandle handle htype                    >>
-               if rc == 0 then
+            result@(J# _ _ d#) -> do
+               let bogus_bounds = (error "fileSize"::(Int,Int))
+                rc <- _ccall_ fileSize (filePtr other) 
+                               (ByteArray bogus_bounds d#)
+                writeHandle handle htype
+                if rc == 0 then
                   return result
-               else
-                   constructErrorAndFail "hFileSize"
+                 else
+                  constructErrorAndFail "hFileSize"
 \end{code}
 
 For a readable handle {\em hdl}, computation $hIsEOF hdl$ returns
@@ -357,27 +348,29 @@ the file.  Otherwise, it returns $False$.
 
 \begin{code}
 hIsEOF :: Handle -> IO Bool
-hIsEOF handle =
-    readHandle handle                              >>= \ htype ->
+hIsEOF handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
          fail ioError
-      ClosedHandle -> 
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
          ioe_closedHandle handle
-      SemiClosedHandle _ _ -> 
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
          ioe_closedHandle handle
-      WriteHandle _ _ _ -> 
-         writeHandle handle htype                  >>
-          fail (IOError (Just handle) IllegalOperation "handle is not open for reading")
-      AppendHandle _ _ _ -> 
-         writeHandle handle htype                  >>
-          fail (IOError (Just handle) IllegalOperation "handle is not open for reading")
-      other -> 
-          _ccall_ fileEOF (filePtr other)          `thenIO_Prim` \ rc ->
-         writeHandle handle (markHandle htype)     >>
+      WriteHandle _ _ _ -> do
+         writeHandle handle htype
+          fail (IOError (Just handle) IllegalOperation 
+               "handle is not open for reading")
+      AppendHandle _ _ _ -> do 
+         writeHandle handle htype
+          fail (IOError (Just handle) IllegalOperation 
+               "handle is not open for reading")
+      other -> do
+          rc <- _ccall_ fileEOF (filePtr other)
+         writeHandle handle (markHandle htype)
          case rc of
             0 -> return False
             1 -> return True
@@ -424,35 +417,34 @@ hSetBuffering :: Handle -> BufferMode -> IO ()
 
 hSetBuffering handle mode =
     case mode of
-      (BlockBuffering (Just n)) 
-        | n <= 0 -> fail (IOError (Just handle) InvalidArgument "illegal buffer size")
-      other ->
-         readHandle handle                         >>= \ htype ->
-          if isMarked htype then
-              writeHandle handle htype             >>
+      BlockBuffering (Just n) 
+        | n <= 0 -> fail (IOError (Just handle) InvalidArgument 
+                               "illegal buffer size")
+      other -> do
+         htype <- readHandle handle
+          if isMarked htype then do
+              writeHandle handle htype
               fail (IOError (Just handle) 
                            UnsupportedOperation 
                            "can't set buffering for a dirty handle")
-          else
+           else
               case htype of
-               ErrorHandle ioError ->
-                   writeHandle handle htype        >>
+               ErrorHandle ioError -> do
+                   writeHandle handle htype
                    fail ioError
-                ClosedHandle ->
-                   writeHandle handle htype        >>
+                ClosedHandle -> do
+                   writeHandle handle htype
                    ioe_closedHandle handle
-                SemiClosedHandle _ _ ->
-                   writeHandle handle htype        >>
+                SemiClosedHandle _ _ -> do
+                   writeHandle handle htype
                    ioe_closedHandle handle
-                other ->
-                    _ccall_ setBuffering (filePtr other) bsize
-                                                   `thenIO_Prim` \ rc -> 
+                other -> do
+                    rc <- _ccall_ setBuffering (filePtr other) bsize
                     if rc == 0 then
-                        writeHandle handle ((hcon other) (filePtr other) (Just mode) True)
-                                                   >>
-                       return ()
-                    else
-                       writeHandle handle htype         >>
+                        writeHandle handle ((hcon other) (filePtr other) 
+                                               (Just mode) True)
+                     else do
+                       writeHandle handle htype
                        constructErrorAndFail "hSetBuffering"
                
   where
@@ -485,25 +477,25 @@ Computation $flush hdl$ causes any items buffered for output in handle
 
 \begin{code}
 hFlush :: Handle -> IO () 
-hFlush handle = 
-    readHandle handle                              >>= \ htype ->
+hFlush handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
          fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other ->
-         _ccall_ flushFile (filePtr other)         `thenIO_Prim` \ rc ->
-         writeHandle handle (markHandle htype)   >>
-               if rc == 0 then 
-                  return ()
-               else
-                   constructErrorAndFail "hFlush"
+      other -> do
+         rc <- _ccall_ flushFile (filePtr other)
+         writeHandle handle (markHandle htype)
+          if rc == 0 then 
+               return ()
+           else
+               constructErrorAndFail "hFlush"
 \end{code}
 
 
@@ -527,49 +519,49 @@ to a previously obtained position {\em p}.
 
 \begin{code}
 hGetPosn :: Handle -> IO HandlePosn
-hGetPosn handle = 
-    readHandle handle                              >>= \ htype ->
+hGetPosn handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
          fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other -> 
-          _ccall_ getFilePosn (filePtr other)      `thenIO_Prim` \ posn ->
-          writeHandle handle htype                 >>
+      other -> do
+          posn <- _ccall_ getFilePosn (filePtr other)
+          writeHandle handle htype
           if posn /= -1 then
              return (HandlePosn handle posn)
-          else
+           else
              constructErrorAndFail "hGetPosn"
 
 hSetPosn :: HandlePosn -> IO () 
-hSetPosn (HandlePosn handle posn) = 
-    readHandle handle                              >>= \ htype ->
+hSetPosn (HandlePosn handle posn) = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
          fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      AppendHandle _ _ _ ->
-         writeHandle handle htype                  >>
+      AppendHandle _ _ _ -> do
+         writeHandle handle htype
          fail (IOError (Just handle) IllegalOperation "handle is not seekable")
-      other -> 
-         _ccall_ setFilePosn (filePtr other) posn `thenIO_Prim` \ rc ->
-         writeHandle handle (markHandle htype)    >>
-               if rc == 0 then 
-                  return ()
-               else
-                  constructErrorAndFail "hSetPosn"
+      other -> do
+         rc <- _ccall_ setFilePosn (filePtr other) posn
+         writeHandle handle (markHandle htype)
+          if rc == 0 then 
+               return ()
+           else
+               constructErrorAndFail "hSetPosn"
 \end{code}
 
 Computation $hSeek hdl mode i$ sets the position of handle
@@ -594,35 +586,35 @@ file, an I/O position beyond the current end-of-file.
 
 \begin{code}
 hSeek :: Handle -> SeekMode -> Integer -> IO () 
-hSeek handle mode offset@(J# _ s# d#) = 
-    readHandle handle                              >>= \ htype ->
+hSeek handle mode offset@(J# _ s# d#) =  do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
          fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      AppendHandle _ _ _ ->
-         writeHandle handle htype                  >>
+      AppendHandle _ _ _ -> do
+         writeHandle handle htype
          fail (IOError (Just handle) IllegalOperation "handle is not seekable")
-      other -> 
-         _ccall_ seekFile (filePtr other) whence (I# s#) (ByteArray (0,0) d#)
-                                                   `thenIO_Prim` \ rc ->
-         writeHandle handle (markHandle htype)   >>
-               if rc == 0 then 
-                  return ()
-               else
-                   constructErrorAndFail "hSeek"
+      other -> do
+         rc <- _ccall_ seekFile (filePtr other) whence (I# s#) 
+                       (ByteArray (0,0) d#)
+         writeHandle handle (markHandle htype)
+          if rc == 0 then 
+               return ()
+           else
+               constructErrorAndFail "hSeek"
   where
     whence :: Int
     whence = case mode of
                AbsoluteSeek -> ``SEEK_SET''
                RelativeSeek -> ``SEEK_CUR''
-               SeekFromEnd -> ``SEEK_END''
+               SeekFromEnd  -> ``SEEK_END''
 \end{code}
 
 %*********************************************************
@@ -643,51 +635,51 @@ $( Just n )$ for block-buffering of {\em n} bytes.
 
 \begin{code}
 hIsOpen :: Handle -> IO Bool
-hIsOpen handle = 
-    readHandle handle                              >>= \ htype ->
+hIsOpen handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
          return False
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
          return False
-      other ->
-         writeHandle handle htype                  >>
+      other -> do
+         writeHandle handle htype
          return True
 
 hIsClosed :: Handle -> IO Bool
-hIsClosed handle = 
-    readHandle handle                              >>= \ htype ->
+hIsClosed handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
          return True
-      other ->
-         writeHandle handle htype                  >>
+      other -> do
+         writeHandle handle htype
          return False
 
 hIsReadable :: Handle -> IO Bool
-hIsReadable handle = 
-    readHandle handle                              >>= \ htype ->
+hIsReadable handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other ->
-         writeHandle handle htype                  >>
+      other -> do
+         writeHandle handle htype
          return (isReadable other)
   where
     isReadable (ReadHandle _ _ _) = True
@@ -695,20 +687,20 @@ hIsReadable handle =
     isReadable _ = False
 
 hIsWritable :: Handle -> IO Bool
-hIsWritable handle = 
-    readHandle handle                      >>= \ htype ->
+hIsWritable handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype          >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype          >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype          >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other ->
-         writeHandle handle htype          >>
+      other -> do
+         writeHandle handle htype
          return (isWritable other)
   where
     isWritable (AppendHandle _ _ _) = True
@@ -716,12 +708,12 @@ hIsWritable handle =
     isWritable (ReadWriteHandle _ _ _) = True
     isWritable _ = False
 
-getBufferMode :: Handle__ -> PrimIO Handle__
+getBufferMode :: Handle__ -> IO Handle__
 getBufferMode htype =
     case bufferMode htype of
-      Just x -> returnPrimIO htype
-      Nothing ->
-       _ccall_ getBufferMode (filePtr htype)       `thenPrimIO` \ rc ->
+      Just x -> return htype
+      Nothing -> do
+       rc <- _ccall_ getBufferMode (filePtr htype)
        let 
            mode = 
                case rc of
@@ -730,129 +722,128 @@ getBufferMode htype =
                  -2 -> Just (BlockBuffering Nothing)
                   -3 -> Nothing
                   n  -> Just (BlockBuffering (Just n))
-       in
-       returnPrimIO (case htype of
+       return (case htype of
          ReadHandle      fp _ b -> ReadHandle      fp mode b
          WriteHandle     fp _ b -> WriteHandle     fp mode b
          AppendHandle    fp _ b -> AppendHandle    fp mode b
          ReadWriteHandle fp _ b -> ReadWriteHandle fp mode b)
 
 hIsBlockBuffered :: Handle -> IO (Bool,Maybe Int)
-hIsBlockBuffered handle =
-    readHandle handle                              >>= \ htype ->
+hIsBlockBuffered handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other ->
-          getBufferMode other                      `thenIO_Prim` \ other ->
+      other -> do
+          other <- getBufferMode other
           case bufferMode other of
-            Just (BlockBuffering size) ->
-               writeHandle handle other            >>
+            Just (BlockBuffering size) -> do
+               writeHandle handle other
                 return (True, size)
-            Just _ ->
-               writeHandle handle other            >>
+            Just _ -> do
+               writeHandle handle other
                 return (False, Nothing)
            Nothing -> 
                constructErrorAndFail "hIsBlockBuffered"
 
 hIsLineBuffered :: Handle -> IO Bool
-hIsLineBuffered handle =
-    readHandle handle                              >>= \ htype ->
+hIsLineBuffered handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other ->
-         getBufferMode other                       `thenIO_Prim` \ other ->
+      other -> do
+         other <- getBufferMode other
           case bufferMode other of
-            Just LineBuffering ->
-               writeHandle handle other            >>
+            Just LineBuffering -> do
+               writeHandle handle other
                 return True
-            Just _ ->
-               writeHandle handle other            >>
+            Just _ -> do
+               writeHandle handle other
                 return False
            Nothing -> 
                constructErrorAndFail "hIsLineBuffered"
 
 hIsNotBuffered :: Handle -> IO Bool
-hIsNotBuffered handle =
-    readHandle handle                              >>= \ htype ->
+hIsNotBuffered handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other ->
-         getBufferMode other                       `thenIO_Prim` \ other ->
+      other -> do
+         other <- getBufferMode other
           case bufferMode other of
-            Just NoBuffering ->
-               writeHandle handle other            >>
+            Just NoBuffering -> do
+               writeHandle handle other
                 return True
-            Just _ ->
-               writeHandle handle other            >>
+            Just _ -> do
+               writeHandle handle other
                 return False
            Nothing -> 
                constructErrorAndFail "hIsNotBuffered"
 
 hGetBuffering :: Handle -> IO BufferMode
-hGetBuffering handle =
-    readHandle handle                              >>= \ htype ->
+hGetBuffering handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      other ->
-         getBufferMode other                       `thenIO_Prim` \ other ->
+      other -> do
+         other <- getBufferMode other
           case bufferMode other of
-            Just v ->
-               writeHandle handle other            >>
+            Just v -> do
+               writeHandle handle other
                 return v
            Nothing -> 
                constructErrorAndFail "hGetBuffering"
 
 hIsSeekable :: Handle -> IO Bool
-hIsSeekable handle = 
-    readHandle handle                              >>= \ htype ->
+hIsSeekable handle = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
           ioe_closedHandle handle
-      AppendHandle _ _ _ ->
-         writeHandle handle htype                  >>
+      AppendHandle _ _ _ -> do
+         writeHandle handle htype
          return False
-      other ->
-         _ccall_ seekFileP (filePtr other)         `thenIO_Prim` \ rc ->
-         writeHandle handle htype                  >>
+      other -> do
+         rc <- _ccall_ seekFileP (filePtr other)
+         writeHandle handle htype
          case rc of
             0 -> return False
             1 -> return True
index 3e69348..eaf4d6d 100644 (file)
@@ -34,12 +34,6 @@ module PackBase
        unpackCStringBA#,  -- :: ByteArray#    -> Int# -> [Char]
        unpackNBytesBA#,   -- :: ByteArray#    -> Int# -> [Char]
 
-#ifndef __PARALLEL_HASKELL__
-       unpackCStringFO,   -- :: ForeignObj    -> [Char]
-       unpackNBytesFO,    -- :: ForeignObj    -> Int  -> [Char]
-       unpackCStringFO#,  -- :: ForeignObj#   -> [Char]
-       unpackNBytesFO#,   -- :: ForeignObj#   -> Int# -> [Char]
-#endif
 
        unpackFoldrCString#,  -- **
        unpackAppendCString#  -- **
@@ -47,11 +41,11 @@ module PackBase
        ) where
 
 import PrelBase
-import {-# SOURCE #-} IOBase ( error )
+import {-# SOURCE #-} Error ( error )
 import PrelList ( length )
 import STBase
 import ArrBase
-import Foreign
+import Addr
 
 \end{code}
 
@@ -111,49 +105,6 @@ unpackNBytesST# addr len
 
 \end{code}
 
-
-%*********************************************************
-%*                                                     *
-\subsection{Unpacking Foreigns}
-%*                                                     *
-%*********************************************************
-
-Primitives for converting Foreigns pointing to external
-sequence of bytes into a list of @Char@s (a renamed version
-of the code above).
-
-\begin{code}
-#ifndef __PARALLEL_HASKELL__
-unpackCStringFO :: ForeignObj -> [Char]
-unpackCStringFO (ForeignObj fo#) = unpackCStringFO# fo#
-
-unpackCStringFO# :: ForeignObj# -> [Char]
-unpackCStringFO# fo {- ptr. to NUL terminated string-}
-  = unpack 0#
-  where
-    unpack nh
-      | ch `eqChar#` '\0'# = []
-      | otherwise         = C# ch : unpack (nh +# 1#)
-      where
-       ch = indexCharOffForeignObj# fo nh
-
-unpackNBytesFO :: ForeignObj -> Int -> [Char]
-unpackNBytesFO (ForeignObj fo) (I# l) = unpackNBytesFO# fo l
-
-unpackNBytesFO#    :: ForeignObj# -> Int#   -> [Char]
-  -- This one is called by the compiler to unpack literal strings with NULs in them; rare.
-unpackNBytesFO# fo len
-  = unpack 0#
-    where
-     unpack i
-      | i >=# len  = []
-      | otherwise  = C# ch : unpack (i +# 1#)
-      where
-       ch = indexCharOffForeignObj# fo i
-#endif
-\end{code}
-
-
 %********************************************************
 %*                                                     *
 \subsection{Unpacking ByteArrays}
index aa8ee6f..2957361 100644 (file)
@@ -13,7 +13,7 @@ module PrelBase(
                                -- to import it explicitly
   ) where
 
-import {-# SOURCE #-}  IOBase  ( error )       
+import {-# SOURCE #-} Error ( error )
 import GHC
 
 infixr 9  .
index 038a865..26be5ae 100644 (file)
@@ -22,7 +22,7 @@ module PrelList (
    zip, zip3, zipWith, zipWith3, unzip, unzip3
  ) where
 
-import {-# SOURCE #-}  IOBase  ( error )
+import {-# SOURCE #-} Error ( error )
 import PrelTup
 import PrelBase
 
index 95724b6..72e6d4a 100644 (file)
@@ -21,15 +21,15 @@ module PrelNum where
 
 import PrelBase
 import GHC
-import {-# SOURCE #-}  IOBase  ( error )
+import {-# SOURCE #-} Error ( error )
 import PrelList
 
 import ArrBase ( Array, array, (!) )
-import UnsafeST ( unsafePerformPrimIO )
+import Unsafe   ( unsafePerformIO )
 import Ix      ( Ix(..) )
-import Foreign ()              -- This import tells the dependency analyser to compile Foreign first.
-                               -- There's an implicit dependency on Foreign because the ccalls in
-                               -- PrelNum implicitly mention CCallable.
+import CCall   ()      -- we need the definitions of CCallable and CReturnable
+                       -- for the _ccall_s herein.
+               
 
 infixr 8  ^, ^^, **
 infixl 7  /, %, `quot`, `rem`, `div`, `mod`
@@ -192,12 +192,12 @@ instance  Integral Int    where
     -- OK, so I made it a little stricter.  Shoot me.  (WDP 94/10)
 
     -- following chks for zero divisor are non-standard (WDP)
-    a `quot` b         =  if b /= 0
-                          then a `quotInt` b
-                          else error "Integral.Int.quot{PreludeCore}: divide by 0\n"
-    a `rem` b          =  if b /= 0
-                          then a `remInt` b
-                          else error "Integral.Int.rem{PreludeCore}: divide by 0\n"
+    a `quot` b =  if b /= 0
+                  then a `quotInt` b
+                  else error "Integral.Int.quot{PreludeCore}: divide by 0\n"
+    a `rem` b  =  if b /= 0
+                  then a `remInt` b
+                  else error "Integral.Int.rem{PreludeCore}: divide by 0\n"
 
     x `div` y = if x > 0 && y < 0      then quotInt (x-y-1) y
                else if x < 0 && y > 0  then quotInt (x-y+1) y
@@ -325,8 +325,12 @@ instance  Integral Integer where
     -- the rest are identical to the report default methods;
     -- you get slightly better code if you let the compiler
     -- see them right here:
-    n `quot` d =  q  where (q,r) = quotRem n d
-    n `rem` d  =  r  where (q,r) = quotRem n d
+    n `quot` d =  if d /= 0 then q else 
+                    error "Integral.Integer.quot{PreludeCore}: divide by 0\n"  
+                  where (q,r) = quotRem n d
+    n `rem` d  =  if d /= 0 then r else 
+                    error "Integral.Integer.quot{PreludeCore}: divide by 0\n"  
+                  where (q,r) = quotRem n d
     n `div` d  =  q  where (q,r) = divMod n d
     n `mod` d  =  r  where (q,r) = divMod n d
 
@@ -493,13 +497,13 @@ instance  RealFloat Float  where
     scaleFloat k x     = case decodeFloat x of
                            (m,n) -> encodeFloat m (n+k)
     isNaN x = 
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isFloatNaN x) {- a _pure_function! -}
+      (0::Int) /= unsafePerformIO (_ccall_ isFloatNaN x) {- a _pure_function! -}
     isInfinite x =
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isFloatInfinite x) {- ditto! -}
+      (0::Int) /= unsafePerformIO (_ccall_ isFloatInfinite x) {- ditto! -}
     isDenormalized x =
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isFloatDenormalized x) -- ..
+      (0::Int) /= unsafePerformIO (_ccall_ isFloatDenormalized x) -- ..
     isNegativeZero x =
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isFloatNegativeZero x) -- ...
+      (0::Int) /= unsafePerformIO (_ccall_ isFloatNegativeZero x) -- ...
     isIEEE x    = True
 
 instance  Show Float  where
@@ -645,13 +649,13 @@ instance  RealFloat Double  where
     scaleFloat k x     = case decodeFloat x of
                            (m,n) -> encodeFloat m (n+k)
     isNaN x = 
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isDoubleNaN x) {- a _pure_function! -}
+      (0::Int) /= unsafePerformIO (_ccall_ isDoubleNaN x) {- a _pure_function! -}
     isInfinite x =
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isDoubleInfinite x) {- ditto -}
+      (0::Int) /= unsafePerformIO (_ccall_ isDoubleInfinite x) {- ditto -}
     isDenormalized x =
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isDoubleDenormalized x) -- ..
+      (0::Int) /= unsafePerformIO (_ccall_ isDoubleDenormalized x) -- ..
     isNegativeZero x =
-      (0::Int) /= unsafePerformPrimIO (_ccall_ isDoubleNegativeZero x) -- ...
+      (0::Int) /= unsafePerformIO (_ccall_ isDoubleNegativeZero x) -- ...
     isIEEE x    = True
 
 instance  Show Double  where
index f08cc88..f3a064f 100644 (file)
@@ -4,14 +4,14 @@
 
 \section[PrelRead]{Module @PrelRead@}
 
-The @Read@ class and many of its instances.
+Instances of the Read class.
 
 \begin{code}
 {-# OPTIONS -fno-implicit-prelude #-}
 
 module PrelRead where
 
-import {-# SOURCE #-}  IOBase  ( error )
+import {-# SOURCE #-} Error ( error )
 import PrelNum
 import PrelList
 import PrelTup
@@ -36,6 +36,117 @@ class  Read a  where
 
 %*********************************************************
 %*                                                     *
+\subsection{Utility functions}
+%*                                                     *
+%*********************************************************
+
+\begin{code}
+reads           :: (Read a) => ReadS a
+reads           =  readsPrec 0
+
+read            :: (Read a) => String -> a
+read s          =  case [x | (x,t) <- reads s, ("","") <- lex t] of
+                        [x] -> x
+                        []  -> error "PreludeText.read: no parse"
+                        _   -> error "PreludeText.read: ambiguous parse"
+
+readParen       :: Bool -> ReadS a -> ReadS a
+readParen b g   =  if b then mandatory else optional
+                   where optional r  = g r ++ mandatory r
+                         mandatory r = [(x,u) | ("(",s) <- lex r,
+                                                (x,t)   <- optional s,
+                                                (")",u) <- lex t    ]
+
+
+{-# GENERATE_SPECS readList__ a #-}
+readList__ :: ReadS a -> ReadS [a]
+
+readList__ readx
+  = readParen False (\r -> [pr | ("[",s)  <- lex r, pr <- readl s])
+  where readl  s = [([],t)   | ("]",t)  <- lex s] ++
+                  [(x:xs,u) | (x,t)    <- readx s,
+                              (xs,u)   <- readl2 t]
+       readl2 s = [([],t)   | ("]",t)  <- lex s] ++
+                  [(x:xs,v) | (",",t)  <- lex s,
+                              (x,u)    <- readx t,
+                              (xs,v)   <- readl2 u]
+\end{code}
+
+
+%*********************************************************
+%*                                                     *
+\subsection{Lexical analysis}
+%*                                                     *
+%*********************************************************
+
+This lexer is not completely faithful to the Haskell lexical syntax.
+Current limitations:
+   Qualified names are not handled properly
+   A `--' does not terminate a symbol
+   Octal and hexidecimal numerics are not recognized as a single token
+
+\begin{code}
+lex                   :: ReadS String
+
+lex ""                = [("","")]
+lex (c:s) | isSpace c = lex (dropWhile isSpace s)
+lex ('\'':s)          = [('\'':ch++"'", t) | (ch,'\'':t)  <- lexLitChar s,
+                                              ch /= "'"                ]
+lex ('"':s)           = [('"':str, t)      | (str,t) <- lexString s]
+                        where
+                        lexString ('"':s) = [("\"",s)]
+                        lexString s = [(ch++str, u)
+                                              | (ch,t)  <- lexStrItem s,
+                                                (str,u) <- lexString t  ]
+
+                        lexStrItem ('\\':'&':s) = [("\\&",s)]
+                        lexStrItem ('\\':c:s) | isSpace c
+                            = [("\\&",t) | '\\':t <- [dropWhile isSpace s]]
+                        lexStrItem s            = lexLitChar s
+
+lex (c:s) | isSingle c = [([c],s)]
+          | isSym c    = [(c:sym,t)       | (sym,t) <- [span isSym s]]
+          | isAlpha c  = [(c:nam,t)       | (nam,t) <- [span isIdChar s]]
+          | isDigit c  = [(c:ds++fe,t)    | (ds,s)  <- [span isDigit s],
+                                            (fe,t)  <- lexFracExp s     ]
+          | otherwise  = []    -- bad character
+             where
+              isSingle c =  c `elem` ",;()[]{}_`"
+              isSym c    =  c `elem` "!@#$%&*+./<=>?\\^|:-~"
+              isIdChar c =  isAlphanum c || c `elem` "_'"
+
+              lexFracExp ('.':cs)   = [('.':ds++e,u) | (ds,t) <- lex0Digits cs,
+                                                       (e,u)  <- lexExp t]
+              lexFracExp s          = [("",s)]
+
+              lexExp (e:s) | e `elem` "eE"
+                       = [(e:c:ds,u) | (c:t)  <- [s], c `elem` "+-",
+                                                 (ds,u) <- lexDigits t] ++
+                         [(e:ds,t)   | (ds,t) <- lexDigits s]
+              lexExp s = [("",s)]
+
+lexDigits               :: ReadS String 
+lexDigits               =  nonnull isDigit
+
+-- 0 or more digits
+lex0Digits               :: ReadS String 
+lex0Digits  s            =  [span isDigit s]
+
+nonnull                 :: (Char -> Bool) -> ReadS String
+nonnull p s             =  [(cs,t) | (cs@(_:_),t) <- [span p s]]
+
+lexLitChar              :: ReadS String
+lexLitChar ('\\':s)     =  [('\\':esc, t) | (esc,t) <- lexEsc s]
+        where
+        lexEsc (c:s)     | c `elem` "abfnrtv\\\"'" = [([c],s)]
+        lexEsc s@(d:_)   | isDigit d               = lexDigits s
+        lexEsc _                                   = []
+lexLitChar (c:s)        =  [([c],s)]
+lexLitChar ""           =  []
+\end{code}
+
+%*********************************************************
+%*                                                     *
 \subsection{Instances of @Read@}
 %*                                                     *
 %*********************************************************
@@ -158,46 +269,6 @@ instance (Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e) where
 \end{code}
 
 
-
-%*********************************************************
-%*                                                     *
-\subsection{Utility functions}
-%*                                                     *
-%*********************************************************
-
-\begin{code}
-reads           :: (Read a) => ReadS a
-reads           =  readsPrec 0
-
-read            :: (Read a) => String -> a
-read s          =  case [x | (x,t) <- reads s, ("","") <- lex t] of
-                        [x] -> x
-                        []  -> error "PreludeText.read: no parse"
-                        _   -> error "PreludeText.read: ambiguous parse"
-
-readParen       :: Bool -> ReadS a -> ReadS a
-readParen b g   =  if b then mandatory else optional
-                   where optional r  = g r ++ mandatory r
-                         mandatory r = [(x,u) | ("(",s) <- lex r,
-                                                (x,t)   <- optional s,
-                                                (")",u) <- lex t    ]
-
-{-# GENERATE_SPECS readList__ a #-}
-readList__ :: ReadS a -> ReadS [a]
-
-readList__ readx
-  = readParen False (\r -> [pr | ("[",s)  <- lex r, pr <- readl s])
-  where readl  s = [([],t)   | ("]",t)  <- lex s] ++
-                  [(x:xs,u) | (x,t)    <- readx s,
-                              (xs,u)   <- readl2 t]
-       readl2 s = [([],t)   | ("]",t)  <- lex s] ++
-                  [(x:xs,v) | (",",t)  <- lex s,
-                              (x,u)    <- readx t,
-                              (xs,v)   <- readl2 u]
-\end{code}
-
-
-
 %*********************************************************
 %*                                                     *
 \subsection{Reading characters}
@@ -330,76 +401,3 @@ readRational__ top_s
 \end{code}
 
 
-%*********************************************************
-%*                                                     *
-\subsection{Lexical analysis}
-%*                                                     *
-%*********************************************************
-
-This lexer is not completely faithful to the Haskell lexical syntax.
-Current limitations:
-   Qualified names are not handled properly
-   A `--' does not terminate a symbol
-   Octal and hexidecimal numerics are not recognized as a single token
-
-\begin{code}
-lex                   :: ReadS String
-
-lex ""                = [("","")]
-lex (c:s) | isSpace c = lex (dropWhile isSpace s)
-lex ('\'':s)          = [('\'':ch++"'", t) | (ch,'\'':t)  <- lexLitChar s,
-                                              ch /= "'"                ]
-lex ('"':s)           = [('"':str, t)      | (str,t) <- lexString s]
-                        where
-                        lexString ('"':s) = [("\"",s)]
-                        lexString s = [(ch++str, u)
-                                              | (ch,t)  <- lexStrItem s,
-                                                (str,u) <- lexString t  ]
-
-                        lexStrItem ('\\':'&':s) = [("\\&",s)]
-                        lexStrItem ('\\':c:s) | isSpace c
-                            = [("\\&",t) | '\\':t <- [dropWhile isSpace s]]
-                        lexStrItem s            = lexLitChar s
-
-lex (c:s) | isSingle c = [([c],s)]
-          | isSym c    = [(c:sym,t)       | (sym,t) <- [span isSym s]]
-          | isAlpha c  = [(c:nam,t)       | (nam,t) <- [span isIdChar s]]
-          | isDigit c  = [(c:ds++fe,t)    | (ds,s)  <- [span isDigit s],
-                                            (fe,t)  <- lexFracExp s     ]
-          | otherwise  = []    -- bad character
-             where
-              isSingle c =  c `elem` ",;()[]{}_`"
-              isSym c    =  c `elem` "!@#$%&*+./<=>?\\^|:-~"
-              isIdChar c =  isAlphanum c || c `elem` "_'"
-
-              lexFracExp ('.':cs)   = [('.':ds++e,u) | (ds,t) <- lex0Digits cs,
-                                                       (e,u)  <- lexExp t]
-              lexFracExp s          = [("",s)]
-
-              lexExp (e:s) | e `elem` "eE"
-                       = [(e:c:ds,u) | (c:t)  <- [s], c `elem` "+-",
-                                                 (ds,u) <- lexDigits t] ++
-                         [(e:ds,t)   | (ds,t) <- lexDigits s]
-              lexExp s = [("",s)]
-
-lexDigits               :: ReadS String 
-lexDigits               =  nonnull isDigit
-
--- 0 or more digits
-lex0Digits               :: ReadS String 
-lex0Digits  s            =  [span isDigit s]
-
-nonnull                 :: (Char -> Bool) -> ReadS String
-nonnull p s             =  [(cs,t) | (cs@(_:_),t) <- [span p s]]
-
-lexLitChar              :: ReadS String
-lexLitChar ('\\':s)     =  [('\\':esc, t) | (esc,t) <- lexEsc s]
-        where
-        lexEsc (c:s)     | c `elem` "abfnrtv\\\"'" = [([c],s)]
-        lexEsc s@(d:_)   | isDigit d               = lexDigits s
-        lexEsc _                                   = []
-lexLitChar (c:s)        =  [([c],s)]
-lexLitChar ""           =  []
-\end{code}
-
-
index e76ca30..e400bcd 100644 (file)
@@ -11,7 +11,7 @@ This modules defines the typle data types.
 
 module PrelTup where
 
-import {-# SOURCE #-}  IOBase  ( error )
+import {-# SOURCE #-} Error ( error )
 import PrelBase
 \end{code}
 
index e8d353b..7f35075 100644 (file)
@@ -1,7 +1,7 @@
 %
 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
 %
-\section[STBase]{The @ST@ and @PrimIO@ monads}
+\section[STBase]{The @ST@ monad}
 
 \begin{code}
 {-# OPTIONS -fno-implicit-prelude #-}
@@ -46,17 +46,6 @@ instance Monad (ST s) where
 
 
 
--- here for backward compatibility:
-
-{-# INLINE returnST #-}
-returnST :: a -> ST s a
-thenST  :: ST s a -> (a -> ST s b) -> ST s b
-seqST   :: ST s a -> ST s b -> ST s b
-
-returnST = return
-thenST   = (>>=)
-seqST   = (>>)
-
 fixST :: (a -> ST s a) -> ST s a
 fixST k = ST $ \ s ->
     let (ST k_r)  = k r
@@ -65,55 +54,6 @@ fixST k = ST $ \ s ->
     in
     ans
 
--- more backward compatibility stuff:
-listST         :: [ST s a] -> ST s [a]
-mapST          :: (a -> ST s b) -> [a] -> ST s [b]
-mapAndUnzipST  :: (a -> ST s (b,c)) -> [a] -> ST s ([b],[c])
-
-listST         = accumulate
-mapST          = mapM
-mapAndUnzipST  = mapAndUnzipM
-
-\end{code}
-
-
-%*********************************************************
-%*                                                     *
-\subsection{The @PrimIO@ monad}
-%*                                                     *
-%*********************************************************
-
-\begin{code}
-type PrimIO a = ST RealWorld a
-
-fixPrimIO :: (a -> PrimIO a) -> PrimIO a
-fixPrimIO = fixST
-
--- the following functions are now there for backward compatibility mostly:
-
-{-# GENERATE_SPECS returnPrimIO a #-}
-returnPrimIO    :: a -> PrimIO a
-
-{-# GENERATE_SPECS thenPrimIO b #-}
-thenPrimIO      :: PrimIO a -> (a -> PrimIO b) -> PrimIO b
-
-{-# GENERATE_SPECS seqPrimIO b #-}
-seqPrimIO      :: PrimIO a -> PrimIO b -> PrimIO b
-
-listPrimIO     :: [PrimIO a] -> PrimIO [a]
-mapPrimIO      :: (a -> PrimIO b) -> [a] -> PrimIO [b]
-mapAndUnzipPrimIO :: (a -> PrimIO (b,c)) -> [a] -> PrimIO ([b],[c])
-
-{-# INLINE returnPrimIO #-}
-{-# INLINE thenPrimIO   #-}
-{-# INLINE seqPrimIO  #-}
-
-returnPrimIO     = return
-thenPrimIO       = (>>=)
-seqPrimIO        = (>>)
-listPrimIO       = accumulate
-mapPrimIO        = mapM
-mapAndUnzipPrimIO = mapAndUnzipM
 \end{code}
 
 
diff --git a/ghc/lib/ghc/Unsafe.lhs b/ghc/lib/ghc/Unsafe.lhs
new file mode 100644 (file)
index 0000000..c07c82c
--- /dev/null
@@ -0,0 +1,69 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[Unsafe]{Module @Unsafe@}
+
+These functions have their own module because we definitely don't want
+them to be inlined.
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module Unsafe
+        ( unsafePerformIO, 
+         unsafeInterleaveIO, 
+         unsafeInterleaveST,
+         trace
+        ) where
+\end{code}
+
+\begin{code}
+import PrelBase
+import IOBase
+import STBase
+import Addr
+import {-# SOURCE #-} Error ( error )
+\end{code}
+
+%*********************************************************
+%*                                                     *
+\subsection{Unsafe @IO@ operations}
+%*                                                     *
+%*********************************************************
+
+\begin{code}
+unsafePerformIO        :: IO a -> a
+unsafePerformIO (IO m)
+  = case m realWorld# of
+      IOok _ r   -> r
+      IOfail _ e -> error ("unsafePerformIO: I/O error: " ++ show e ++ "\n")
+
+unsafeInterleaveIO :: IO a -> IO a
+unsafeInterleaveIO (IO m) = IO ( \ s ->
+       let
+           IOok _ r = m s
+       in
+       IOok s r)
+
+{-# GENERATE_SPECS _trace a #-}
+trace :: String -> a -> a
+trace string expr
+  = unsafePerformIO (
+       ((_ccall_ PreTraceHook sTDERR{-msg-}):: IO ())  >>
+       fputs sTDERR string                             >>
+       ((_ccall_ PostTraceHook sTDERR{-msg-}):: IO ()) >>
+       return expr )
+  where
+    sTDERR = (``stderr'' :: Addr)
+\end{code}
+
+\begin{code}
+unsafeInterleaveST :: ST s a -> ST s a
+unsafeInterleaveST (ST m) = ST ( \ s ->
+    let
+       STret _ r = m s
+    in
+    STret s r)
+
+\end{code}
diff --git a/ghc/lib/ghc/UnsafeST.lhs b/ghc/lib/ghc/UnsafeST.lhs
deleted file mode 100644 (file)
index 5f7268d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-%
-% (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
-%
-\section[UnsafeST]{Unsafe ST operations}
-
-VERY IMPORTANT!  This module must be compiled without "-O".  If you
-compile it with "-O" then the inlinings of the unsafe ST operators are exposed.
-It turns out that exposing these inlininings can lead to unsound transformations,
-such as generating a MutVar only once rather than once each call to unsafePerformIO.
-
-\begin{code}
-{-# OPTIONS -fno-implicit-prelude #-}
-\end{code}
-
-
-\begin{code}
-module UnsafeST(
-       unsafeInterleaveST,
-       unsafePerformPrimIO,
-       unsafeInterleavePrimIO
-  )  where
-
-import STBase
-import PrelBase
-import GHC
-
-
-unsafeInterleaveST :: ST s a -> ST s a
-unsafeInterleaveST (ST m) = ST ( \ s ->
-    let
-       STret _ r = m s
-    in
-    STret s r)
-
-unsafePerformPrimIO    :: PrimIO a -> a
-       -- We give a fresh definition here.  There are no
-       -- magical universal types kicking around.
-unsafePerformPrimIO (ST m)
-  = case m realWorld# of
-      STret _ r -> r
-
-unsafeInterleavePrimIO :: PrimIO a -> PrimIO a
-unsafeInterleavePrimIO = unsafeInterleaveST
-\end{code}
-
diff --git a/ghc/lib/glaExts/Addr.lhs b/ghc/lib/glaExts/Addr.lhs
new file mode 100644 (file)
index 0000000..a634094
--- /dev/null
@@ -0,0 +1,31 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[Addr]{Module @Addr@}
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module Addr (
+       Addr(..), -- ToDo: nullAddr,
+   ) where
+
+import GHC
+import PrelBase
+import STBase
+import CCall
+\end{code}
+
+\begin{code}
+data Addr = A# Addr#   deriving (Eq, Ord) -- Glasgow extension
+
+nullAddr = ``NULL'' :: Addr
+
+instance CCallable Addr
+instance CCallable Addr#
+instance CReturnable Addr
+\end{code}
+
+
+
diff --git a/ghc/lib/glaExts/Bits.lhs b/ghc/lib/glaExts/Bits.lhs
new file mode 100644 (file)
index 0000000..3a7a3b3
--- /dev/null
@@ -0,0 +1,37 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
+%
+\section[Bits]{The @Bits@ Module}
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module Bits where
+
+import PrelBase
+
+infixl 8 `shift`, `rotate`
+infixl 7 .&.
+infixl 6 `xor`
+infixl 5 .|.
+
+class Bits a where
+  (.&.), (.|.), xor :: a -> a -> a
+  complement        :: a -> a
+  shift             :: a -> Int -> a
+  rotate            :: a -> Int -> a
+  bit               :: Int -> a
+  setBit            :: a -> Int -> a
+  clearBit          :: a -> Int -> a
+  complementBit     :: a -> Int -> a
+  testBit           :: a -> Int -> Bool
+  bitSize           :: a -> Int
+  isSigned          :: a -> Bool
+
+shiftL, shiftR   :: Bits a => a -> Int -> a
+rotateL, rotateR :: Bits a => a -> Int -> a
+shiftL  a i = shift  a i
+shiftR  a i = shift  a (-i)
+rotateL a i = rotate a i
+rotateR a i = rotate a (-i)
+\end{code}
index f0f66b3..d6326dc 100644 (file)
@@ -33,7 +33,8 @@ module ByteArray
 
 import ArrBase
 import Ix
-import Foreign (Addr, Word)
+import Foreign (Word)
+import Addr
 
 \end{code}
 
diff --git a/ghc/lib/glaExts/CCall.lhs b/ghc/lib/glaExts/CCall.lhs
new file mode 100644 (file)
index 0000000..6de7fbf
--- /dev/null
@@ -0,0 +1,56 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[CCall]{Module @CCall@}
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module CCall (
+       CCallable(..), CReturnable(..),
+       Word(..)
+   ) where
+
+import PrelBase
+import GHC
+\end{code}
+
+%*********************************************************
+%*                                                     *
+\subsection{Classes @CCallable@ and @CReturnable@}
+%*                                                     *
+%*********************************************************
+
+\begin{code}
+class CCallable   a
+class CReturnable a
+
+instance CCallable Char
+instance CCallable   Char#
+instance CReturnable Char
+
+instance CCallable   Int
+instance CCallable   Int#
+instance CReturnable Int
+
+-- DsCCall knows how to pass strings...
+instance CCallable   [Char]
+
+instance CCallable   Float
+instance CCallable   Float#
+instance CReturnable Float
+
+instance CCallable   Double
+instance CCallable   Double#
+instance CReturnable Double
+
+data Word = W# Word#   deriving (Eq, Ord) -- Glasgow extension
+
+instance CCallable Word
+instance CCallable Word#
+instance CReturnable Word
+
+instance CReturnable () -- Why, exactly?
+\end{code}
+
index d72e314..34d0990 100644 (file)
@@ -12,93 +12,55 @@ module Foreign (
 #ifndef __PARALLEL_HASKELL__
        ForeignObj(..),
 #endif
-       Addr(..), Word(..)
+       Word(..),
+
+#ifndef __PARALLEL_HASKELL__
+       unpackCStringFO,   -- :: ForeignObj    -> [Char]
+       unpackNBytesFO,    -- :: ForeignObj    -> Int  -> [Char]
+       unpackCStringFO#,  -- :: ForeignObj#   -> [Char]
+       unpackNBytesFO#    -- :: ForeignObj#   -> Int# -> [Char]
+#endif
    ) where
 
+import IOBase
 import STBase
-import UnsafeST        ( unsafePerformPrimIO )
+import Unsafe
 import PrelBase
+import CCall
+import Addr
 import GHC
 \end{code}
 
 
 %*********************************************************
 %*                                                     *
-\subsection{Classes @CCallable@ and @CReturnable@}
-%*                                                     *
-%*********************************************************
-
-\begin{code}
-class CCallable   a
-class CReturnable a
-
-instance CCallable Char
-instance CCallable   Char#
-instance CReturnable Char
-
-instance CCallable   Int
-instance CCallable   Int#
-instance CReturnable Int
-
--- DsCCall knows how to pass strings...
-instance CCallable   [Char]
-
-instance CCallable   Float
-instance CCallable   Float#
-instance CReturnable Float
-
-instance CCallable   Double
-instance CCallable   Double#
-instance CReturnable Double
-
-data Addr = A# Addr#   deriving (Eq, Ord) -- Glasgow extension
-
-instance CCallable Addr
-instance CCallable Addr#
-instance CReturnable Addr
-
-data Word = W# Word#   deriving (Eq, Ord) -- Glasgow extension
-
-instance CCallable Word
-instance CCallable Word#
-instance CReturnable Word
-
-instance CReturnable () -- Why, exactly?
-\end{code}
-
-
-%*********************************************************
-%*                                                     *
 \subsection{Type @ForeignObj@ and its operations}
 %*                                                     *
 %*********************************************************
 
 \begin{code}
 #ifndef __PARALLEL_HASKELL__
---Defined in PrelBase: data ForeignObj = ForeignObj ForeignObj#
-data ForeignObj = ForeignObj ForeignObj#   -- another one
-
 instance CCallable ForeignObj
 instance CCallable ForeignObj#
 
 eqForeignObj    :: ForeignObj  -> ForeignObj -> Bool
-makeForeignObj  :: Addr        -> Addr       -> PrimIO ForeignObj
-writeForeignObj :: ForeignObj  -> Addr       -> PrimIO ()
+makeForeignObj  :: Addr        -> Addr       -> IO ForeignObj
+writeForeignObj :: ForeignObj  -> Addr       -> IO ()
 
 {- derived op - attaching a free() finaliser to a malloc() allocated reference. -}
-makeMallocPtr   :: Addr        -> PrimIO ForeignObj
+makeMallocPtr   :: Addr        -> IO ForeignObj
 
-makeForeignObj (A# obj) (A# finaliser) = ST ( \ s# ->
+makeForeignObj (A# obj) (A# finaliser) = IO ( \ s# ->
     case makeForeignObj# obj finaliser s# of
-      StateAndForeignObj# s1# fo# -> STret s1# (ForeignObj fo#))
+      StateAndForeignObj# s1# fo# -> IOok s1# (ForeignObj fo#))
 
-writeForeignObj (ForeignObj fo#) (A# datum#) = ST ( \ s# ->
-    case writeForeignObj# fo# datum# s# of { s1# -> STret s1# () } )
+writeForeignObj (ForeignObj fo#) (A# datum#) = IO ( \ s# ->
+    case writeForeignObj# fo# datum# s# of { s1# -> IOok s1# () } )
 
 makeMallocPtr a = makeForeignObj a (``&free''::Addr)
 
 eqForeignObj mp1 mp2
-  = unsafePerformPrimIO (_ccall_ eqForeignObj mp1 mp2) /= (0::Int)
+  = unsafePerformIO (_ccall_ eqForeignObj mp1 mp2) /= (0::Int)
 
 instance Eq ForeignObj where 
     p == q = eqForeignObj p q
@@ -106,7 +68,6 @@ instance Eq ForeignObj where
 #endif /* !__PARALLEL_HASKELL__ */
 \end{code}
 
-
 %*********************************************************
 %*                                                     *
 \subsection{Type @StablePtr@ and its operations}
@@ -124,27 +85,23 @@ instance CReturnable (StablePtr a)
 -- @makeStablePtr#@ since the corresponding macro is very long and we'll
 -- get terrible code-bloat.
 
-makeStablePtr  :: a -> PrimIO (StablePtr a)
-deRefStablePtr :: StablePtr a -> PrimIO a
-freeStablePtr  :: StablePtr a -> PrimIO ()
-performGC      :: PrimIO ()
+makeStablePtr  :: a -> IO (StablePtr a)
+deRefStablePtr :: StablePtr a -> IO a
+freeStablePtr  :: StablePtr a -> IO ()
 
 {-# INLINE deRefStablePtr #-}
 {-# INLINE freeStablePtr #-}
-{-# INLINE performGC #-}
 
-makeStablePtr f = ST $ \ rw1# ->
+makeStablePtr f = IO $ \ rw1# ->
     case makeStablePtr# f rw1# of
-      StateAndStablePtr# rw2# sp# -> STret rw2# (StablePtr sp#)
+      StateAndStablePtr# rw2# sp# -> IOok rw2# (StablePtr sp#)
 
-deRefStablePtr (StablePtr sp#) = ST $ \ rw1# ->
+deRefStablePtr (StablePtr sp#) = IO $ \ rw1# ->
     case deRefStablePtr# sp# rw1# of
-      StateAndPtr# rw2# a -> STret rw2# a
+      StateAndPtr# rw2# a -> IOok rw2# a
 
 freeStablePtr sp = _ccall_ freeStablePointer sp
 
-performGC = _ccall_GC_ StgPerformGarbageCollection
-
 #endif /* !__PARALLEL_HASKELL__ */
 \end{code}
 
@@ -160,3 +117,46 @@ data StateAndStablePtr# s a = StateAndStablePtr# (State# s) (StablePtr# a)
 #endif
 data StateAndForeignObj# s  = StateAndForeignObj# (State# s) ForeignObj#
 \end{code}
+
+%*********************************************************
+%*                                                     *
+\subsection{Unpacking Foreigns}
+%*                                                     *
+%*********************************************************
+
+Primitives for converting Foreigns pointing to external
+sequence of bytes into a list of @Char@s (a renamed version
+of the code above).
+
+\begin{code}
+#ifndef __PARALLEL_HASKELL__
+unpackCStringFO :: ForeignObj -> [Char]
+unpackCStringFO (ForeignObj fo#) = unpackCStringFO# fo#
+
+unpackCStringFO# :: ForeignObj# -> [Char]
+unpackCStringFO# fo {- ptr. to NUL terminated string-}
+  = unpack 0#
+  where
+    unpack nh
+      | ch `eqChar#` '\0'# = []
+      | otherwise         = C# ch : unpack (nh +# 1#)
+      where
+       ch = indexCharOffForeignObj# fo nh
+
+unpackNBytesFO :: ForeignObj -> Int -> [Char]
+unpackNBytesFO (ForeignObj fo) (I# l) = unpackNBytesFO# fo l
+
+unpackNBytesFO#    :: ForeignObj# -> Int#   -> [Char]
+  -- This one is called by the compiler to unpack literal strings with NULs in them; rare.
+unpackNBytesFO# fo len
+  = unpack 0#
+    where
+     unpack i
+      | i >=# len  = []
+      | otherwise  = C# ch : unpack (i +# 1#)
+      where
+       ch = indexCharOffForeignObj# fo i
+#endif
+\end{code}
+
+
index eb89c9c..525dc92 100644 (file)
@@ -14,32 +14,15 @@ GHC interfaces - instead import the GlaExts rag bag and you should be away!
 module GlaExts
 
        (
-        -- From module STBase, the PrimIO monad 
-        -- (an instance of ST):
-       PrimIO,
         ST, RealWorld,
 
-       thenPrimIO,     -- 
-        returnPrimIO, 
-       seqPrimIO,
-        fixPrimIO, 
-       unsafePerformPrimIO, 
-       unsafeInterleavePrimIO,
+       unsafePerformIO, 
+       unsafeInterleaveIO,
         
-       -- backwards compatibility
-        listPrimIO,        -- :: [PrimIO a] -> PrimIO [a]
-       mapPrimIO,         -- :: (a -> PrimIO b) -> [a] -> PrimIO [b]
-        mapAndUnzipPrimIO, -- :: (a -> PrimIO (b,c)) -> [a] -> PrimIO ([b],[c])
-
-
-        -- operations for interfacing IO and ST/PrimIO
+        -- operations for interfacing IO and ST
         --
         stToIO,       -- :: ST RealWorld a -> IO a
-       primIOToIO,   -- :: PrimIO a       -> IO a
        ioToST,       -- :: IO a -> ST RealWorld a
-       ioToPrimIO,   -- :: IO a -> PrimIO       a
-        thenIO_Prim,  -- :: PrimIO a -> (a -> IO b) -> IO b
-        seqIO_Prim,   -- :: PrimIO a -> IO b -> IO b
 
         -- Everything from module ByteArray:
        module ByteArray,
@@ -61,7 +44,7 @@ module GlaExts
 
 import GHC
 import STBase
-import UnsafeST
+import IOExts
 import PrelBase
 import ByteArray
 import MutableArray
diff --git a/ghc/lib/glaExts/IOExts.lhs b/ghc/lib/glaExts/IOExts.lhs
new file mode 100644 (file)
index 0000000..ed8a3c1
--- /dev/null
@@ -0,0 +1,31 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[IOExts]{Module @IOExts@}
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module IOExts
+        ( fixIO
+        , unsafePerformIO
+        , unsafeInterleaveIO
+
+        , IORef
+          -- instance Eq (MutVar a)
+        , newIORef
+        , readIORef
+        , writeIORef
+
+        , trace
+        , performGC
+        ) where
+\end{code}
+
+\begin{code}
+import IOBase
+import IORef
+import STBase
+import Unsafe
+\end{code}
diff --git a/ghc/lib/glaExts/IORef.lhs b/ghc/lib/glaExts/IORef.lhs
new file mode 100644 (file)
index 0000000..85c6520
--- /dev/null
@@ -0,0 +1,34 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[IORef]{Module @IORef@}
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module IORef (
+       IORef,
+       newIORef,
+       readIORef,
+       writeIORef
+   ) where
+
+import PrelBase
+import ArrBase
+import IOBase
+import STBase
+\end{code}
+
+\begin{code}
+newtype IORef a = IORef (MutableVar RealWorld a) deriving Eq
+
+newIORef :: a -> IO (IORef a)
+newIORef v = stToIO (newVar v) >>= \ var -> return (IORef var)
+
+readIORef :: IORef a -> IO a
+readIORef (IORef var) = stToIO (readVar var)
+
+writeIORef :: IORef a -> a -> IO ()
+writeIORef (IORef var) v = stToIO (writeVar var v)
+\end{code}
diff --git a/ghc/lib/glaExts/Int.lhs b/ghc/lib/glaExts/Int.lhs
new file mode 100644 (file)
index 0000000..b539bae
--- /dev/null
@@ -0,0 +1,346 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[Int]{Module @Int@}
+
+This code is largely copied from the Hugs library of the same name.
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+-----------------------------------------------------------------------------
+-- Signed Integers
+-- Suitable for use with Hugs 1.4 on 32 bit systems.
+-----------------------------------------------------------------------------
+
+module Int
+       ( Int8
+       , Int16
+       , Int32
+       --, Int64
+       , int8ToInt  -- :: Int8  -> Int
+       , intToInt8  -- :: Int   -> Int8
+       , int16ToInt -- :: Int16 -> Int
+       , intToInt16 -- :: Int   -> Int16
+       , int32ToInt -- :: Int32 -> Int
+       , intToInt32 -- :: Int   -> Int32
+       -- plus Eq, Ord, Num, Bounded, Real, Integral, Ix, Enum, Read,
+       --  Show and Bits instances for each of Int8, Int16 and Int32
+       ) where
+
+import PrelBase
+import PrelNum
+import PrelRead
+import Ix
+import Error
+import Bits
+import GHC
+
+-----------------------------------------------------------------------------
+-- The "official" coercion functions
+-----------------------------------------------------------------------------
+
+int8ToInt  :: Int8  -> Int
+intToInt8  :: Int   -> Int8
+int16ToInt :: Int16 -> Int
+intToInt16 :: Int   -> Int16
+int32ToInt :: Int32 -> Int
+intToInt32 :: Int   -> Int32
+
+-- And some non-exported ones
+
+int8ToInt16  :: Int8  -> Int16
+int8ToInt32  :: Int8  -> Int32
+int16ToInt8  :: Int16 -> Int8
+int16ToInt32 :: Int16 -> Int32
+int32ToInt8  :: Int32 -> Int8
+int32ToInt16 :: Int32 -> Int16
+
+int8ToInt16  = I16 . int8ToInt
+int8ToInt32  = I32 . int8ToInt
+int16ToInt8  = I8  . int16ToInt
+int16ToInt32 = I32 . int16ToInt
+int32ToInt8  = I8  . int32ToInt
+int32ToInt16 = I16 . int32ToInt
+
+-----------------------------------------------------------------------------
+-- Int8
+-----------------------------------------------------------------------------
+
+newtype Int8  = I8 Int
+
+int8ToInt (I8 x) = if x' <= 0x7f then x' else x' - 0x100
+   where x' = case x of { I# x ->
+               I# (word2Int# (int2Word# x `and#` int2Word# 0xff#))
+             }
+intToInt8 = I8
+
+instance Eq  Int8     where (==)    = binop (==)
+instance Ord Int8     where compare = binop compare
+
+instance Num Int8 where
+    x + y         = to (binop (+) x y)
+    x - y         = to (binop (-) x y)
+    negate        = to . negate . from
+    x * y         = to (binop (*) x y)
+    abs           = absReal
+    signum        = signumReal
+    fromInteger   = to . fromInteger
+    fromInt       = to
+
+instance Bounded Int8 where
+    minBound = 0x80
+    maxBound = 0x7f 
+
+instance Real Int8 where
+    toRational x = toInteger x % 1
+
+instance Integral Int8 where
+    x `div` y     = to  (binop div x y)
+    x `quot` y    = to  (binop quot x y)
+    x `rem` y     = to  (binop rem x y)
+    x `mod` y     = to  (binop mod x y)
+    x `quotRem` y = to2 (binop quotRem x y)
+    toInteger     = toInteger . from
+    toInt         = toInt     . from
+
+instance Ix Int8 where
+    range (m,n)          = [m..n]
+    index b@(m,n) i
+             | inRange b i = from (i - m)
+             | otherwise   = error "index: Index out of range"
+    inRange (m,n) i      = m <= i && i <= n
+
+instance Enum Int8 where
+    toEnum         = to 
+    fromEnum       = from
+    enumFrom c       = map toEnum [fromEnum c .. fromEnum (maxBound::Int8)]
+    enumFromThen c d = map toEnum [fromEnum c, fromEnum d .. fromEnum (last::Int8)]
+                         where last = if d < c then minBound else maxBound
+
+instance Read Int8 where
+    readsPrec p s = [ (to x,r) | (x,r) <- readsPrec p s ]
+
+instance Show Int8 where
+    showsPrec p = showsPrec p . from
+
+binop8 :: (Int32 -> Int32 -> a) -> (Int8 -> Int8 -> a)
+binop8 op x y = int8ToInt32 x `op` int8ToInt32 y
+
+instance Bits Int8 where
+  x .&. y       = int32ToInt8 (binop8 (.&.) x y)
+  x .|. y       = int32ToInt8 (binop8 (.|.) x y)
+  x `xor` y     = int32ToInt8 (binop8 xor x y)
+  complement    = int32ToInt8 . complement . int8ToInt32
+  x `shift` i   = int32ToInt8 (int8ToInt32 x `shift` i)
+--  rotate      
+  bit           = int32ToInt8 . bit
+  setBit x i    = int32ToInt8 (setBit (int8ToInt32 x) i)
+  clearBit x i  = int32ToInt8 (clearBit (int8ToInt32 x) i)
+  complementBit x i = int32ToInt8 (complementBit (int8ToInt32 x) i)
+  testBit x i   = testBit (int8ToInt32 x) i
+  bitSize  _    = 8
+  isSigned _    = True
+
+-----------------------------------------------------------------------------
+-- Int16
+-----------------------------------------------------------------------------
+
+newtype Int16  = I16 Int
+
+int16ToInt (I16 x) = if x' <= 0x7fff then x' else x' - 0x10000
+   where x' = case x of { I# x ->
+               I# (word2Int# (int2Word# x `and#` int2Word# 0xffff#))
+             }
+intToInt16 = I16
+
+instance Eq  Int16     where (==)    = binop (==)
+instance Ord Int16     where compare = binop compare
+
+instance Num Int16 where
+    x + y         = to (binop (+) x y)
+    x - y         = to (binop (-) x y)
+    negate        = to . negate . from
+    x * y         = to (binop (*) x y)
+    abs           = absReal
+    signum        = signumReal
+    fromInteger   = to . fromInteger
+    fromInt       = to
+
+instance Bounded Int16 where
+    minBound = 0x8000
+    maxBound = 0x7fff 
+
+instance Real Int16 where
+    toRational x = toInteger x % 1
+
+instance Integral Int16 where
+    x `div` y     = to  (binop div x y)
+    x `quot` y    = to  (binop quot x y)
+    x `rem` y     = to  (binop rem x y)
+    x `mod` y     = to  (binop mod x y)
+    x `quotRem` y = to2 (binop quotRem x y)
+    toInteger     = toInteger . from
+    toInt         = toInt     . from
+
+instance Ix Int16 where
+    range (m,n)          = [m..n]
+    index b@(m,n) i
+             | inRange b i = from (i - m)
+             | otherwise   = error "index: Index out of range"
+    inRange (m,n) i      = m <= i && i <= n
+
+instance Enum Int16 where
+    toEnum         = to 
+    fromEnum       = from
+    enumFrom c       = map toEnum [fromEnum c .. fromEnum (maxBound::Int16)]
+    enumFromThen c d = map toEnum [fromEnum c, fromEnum d .. fromEnum (last::Int16)]
+                         where last = if d < c then minBound else maxBound
+
+instance Read Int16 where
+    readsPrec p s = [ (to x,r) | (x,r) <- readsPrec p s ]
+
+instance Show Int16 where
+    showsPrec p = showsPrec p . from
+
+binop16 :: (Int32 -> Int32 -> a) -> (Int16 -> Int16 -> a)
+binop16 op x y = int16ToInt32 x `op` int16ToInt32 y
+
+instance Bits Int16 where
+  x .&. y       = int32ToInt16 (binop16 (.&.) x y)
+  x .|. y       = int32ToInt16 (binop16 (.|.) x y)
+  x `xor` y     = int32ToInt16 (binop16 xor x y)
+  complement    = int32ToInt16 . complement . int16ToInt32
+  x `shift` i   = int32ToInt16 (int16ToInt32 x `shift` i)
+--  rotate      
+  bit           = int32ToInt16 . bit
+  setBit x i    = int32ToInt16 (setBit (int16ToInt32 x) i)
+  clearBit x i  = int32ToInt16 (clearBit (int16ToInt32 x) i)
+  complementBit x i = int32ToInt16 (complementBit (int16ToInt32 x) i)
+  testBit x i   = testBit (int16ToInt32 x) i
+  bitSize  _    = 16
+  isSigned _    = True
+
+-----------------------------------------------------------------------------
+-- Int32
+-----------------------------------------------------------------------------
+
+newtype Int32  = I32 Int
+
+int32ToInt (I32 x) = x
+intToInt32 = I32
+
+instance Eq  Int32     where (==)    = binop (==)
+instance Ord Int32     where compare = binop compare
+
+instance Num Int32 where
+    x + y         = to (binop (+) x y)
+    x - y         = to (binop (-) x y)
+    negate        = to . negate . from
+    x * y         = to (binop (*) x y)
+    abs           = absReal
+    signum        = signumReal
+    fromInteger   = to . fromInteger
+    fromInt       = to
+
+instance Bounded Int32 where
+    minBound = to minBound
+    maxBound = to maxBound
+
+instance Real Int32 where
+    toRational x = toInteger x % 1
+
+instance Integral Int32 where
+    x `div` y     = to  (binop div x y)
+    x `quot` y    = to  (binop quot x y)
+    x `rem` y     = to  (binop rem x y)
+    x `mod` y     = to  (binop mod x y)
+    x `quotRem` y = to2 (binop quotRem x y)
+    toInteger     = toInteger . from
+    toInt         = toInt     . from
+
+instance Ix Int32 where
+    range (m,n)          = [m..n]
+    index b@(m,n) i
+             | inRange b i = from (i - m)
+             | otherwise   = error "index: Index out of range"
+    inRange (m,n) i      = m <= i && i <= n
+
+instance Enum Int32 where
+    toEnum         = to 
+    fromEnum       = from
+    enumFrom c       = map toEnum [fromEnum c .. fromEnum (maxBound::Int32)]
+    enumFromThen c d = map toEnum [fromEnum c, fromEnum d .. fromEnum (last::Int32)]
+                         where last = if d < c then minBound else maxBound
+
+instance Read Int32 where
+    readsPrec p s = [ (to x,r) | (x,r) <- readsPrec p s ]
+
+instance Show Int32 where
+    showsPrec p = showsPrec p . from
+
+instance Bits Int32 where
+  x .&. y              = to (binop (wordop and#) x y)
+  x .|. y              = to (binop (wordop or# ) x y)
+  x `xor` y            = to (binop (wordop xor#) x y)
+  complement x         = (x `xor` maxBound) + 1
+  shift (I32 (I# x)) i@(I# i#)
+       | i > 0     = I32 (I# (iShiftRL# x i#))
+       | otherwise = I32 (I# (iShiftL# x i#))
+--  rotate        
+  bit i                = 1 `shift` -i
+  setBit x i    = x .|. bit i
+  clearBit x i  = x .&. complement (bit i)
+  complementBit x i = x `xor` bit i
+  testBit x i   = (x .&. bit i) /= 0
+  bitSize  _    = 32
+  isSigned _    = True
+
+{-# INLINE wordop #-}
+wordop op (I# x) (I# y) = I# (word2Int# (int2Word# x `op` int2Word# y))
+
+-----------------------------------------------------------------------------
+-- End of exported definitions
+--
+-- The remainder of this file consists of definitions which are only
+-- used in the implementation.
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Coercions - used to make the instance declarations more uniform
+-----------------------------------------------------------------------------
+
+class Coerce a where
+  to   :: Int -> a
+  from :: a -> Int
+
+instance Coerce Int32 where
+  from = int32ToInt
+  to   = intToInt32
+
+instance Coerce Int8 where
+  from = int8ToInt
+  to   = intToInt8
+
+instance Coerce Int16 where
+  from = int16ToInt
+  to   = intToInt16
+
+binop :: Coerce int => (Int -> Int -> a) -> (int -> int -> a)
+binop op x y = from x `op` from y
+
+to2 :: Coerce int => (Int, Int) -> (int, int)
+to2 (x,y) = (to x, to y)
+
+-----------------------------------------------------------------------------
+-- Code copied from the Prelude
+-----------------------------------------------------------------------------
+
+absReal x    | x >= 0    = x
+            | otherwise = -x
+
+signumReal x | x == 0    =  0
+            | x > 0     =  1
+            | otherwise = -1
+\end{code}
diff --git a/ghc/lib/glaExts/LazyST.lhs b/ghc/lib/glaExts/LazyST.lhs
new file mode 100644 (file)
index 0000000..d6fb8f6
--- /dev/null
@@ -0,0 +1,104 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1997
+%
+
+\section[LazyST]{The Lazy State Transformer Monad, @LazyST@}
+
+This module presents an identical interface to ST, but the underlying
+implementation of the state thread is lazy.
+
+\begin{code}
+module LazyST (
+
+       STBase.ST,
+
+       unsafeInterleaveST,
+
+        -- ST is one, so you'll likely need some Monad bits
+        module Monad,
+
+       ST.STRef,
+       newSTRef, readSTRef, writeSTRef,
+
+       ST.STArray,
+       newSTArray, readSTArray, writeSTArray, Ix,
+
+       strictToLazyST, lazyToStrictST
+    ) where
+
+import qualified ST
+import qualified STBase
+import ArrBase
+import Unsafe   ( unsafeInterleaveST )
+import PrelBase        ( Eq(..), Int, Bool, ($), ()(..) )
+import Monad
+import Ix
+
+newtype ST s a = ST (STBase.State s -> (a,STBase.State s))
+
+instance Monad (ST s) where
+
+        return a = ST $ \ s -> (a,s)
+        m >> k   =  m >>= \ _ -> k
+
+        (ST m) >>= k
+         = ST $ \ s ->
+           let
+             (r,new_s) = m s
+             ST k_a = k r
+           in
+           k_a new_s
+\end{code}
+
+%*********************************************************
+%*                                                     *
+\subsection{Variables}
+%*                                                     *
+%*********************************************************
+
+\begin{code}
+newSTRef   :: a -> ST s (ST.STRef s a)
+readSTRef  :: ST.STRef s a -> ST s a
+writeSTRef :: ST.STRef s a -> a -> ST s ()
+
+newSTRef   = strictToLazyST . ST.newSTRef
+readSTRef  = strictToLazyST . ST.readSTRef
+writeSTRef r a = strictToLazyST (ST.writeSTRef r a)
+\end{code}
+
+%*********************************************************
+%*                                                     *
+\subsection{Arrays}
+%*                                                     *
+%*********************************************************
+
+\begin{code}
+type STArray s ix elt = MutableArray s ix elt
+
+newSTArray         :: Ix ix => (ix,ix) -> elt -> ST s (STArray s ix elt)
+readSTArray        :: Ix ix => STArray s ix elt -> ix -> ST s elt 
+writeSTArray       :: Ix ix => STArray s ix elt -> ix -> elt -> ST s () 
+boundsSTArray       :: Ix ix => STArray s ix elt -> (ix, ix)  
+thawSTArray        :: Ix ix => Array ix elt -> ST s (STArray s ix elt)
+freezeSTArray      :: Ix ix => STArray s ix elt -> ST s (Array ix elt)
+unsafeFreezeSTArray :: Ix ix => STArray s ix elt -> ST s (Array ix elt)
+
+newSTArray ixs init    = strictToLazyST (newArray ixs init)
+readSTArray arr ix     = strictToLazyST (readArray arr ix)
+writeSTArray arr ix v  = strictToLazyST (writeArray arr ix v)
+boundsSTArray          = boundsOfArray
+thawSTArray            = strictToLazyST . thawArray
+freezeSTArray          = strictToLazyST . freezeArray
+unsafeFreezeSTArray    = strictToLazyST . unsafeFreezeArray
+
+strictToLazyST :: STBase.ST s a -> ST s a
+strictToLazyST (STBase.ST m) = ST $ \s ->
+        let STBase.S# s# = s in
+       case m s# of { STBase.STret s2# r -> (r, STBase.S# s2#) }
+
+lazyToStrictST :: ST s a -> STBase.ST s a
+lazyToStrictST (ST m) = STBase.ST $ \s ->
+        case (m (STBase.S# s)) of (a, STBase.S# s') -> STBase.STret s' a
+
+
+\end{code}
diff --git a/ghc/lib/glaExts/MutVar.lhs b/ghc/lib/glaExts/MutVar.lhs
deleted file mode 100644 (file)
index c0a0f2a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-%
-% (c) The AQUA Project, Glasgow University, 1994-1996
-%
-\section[MutVar]{Mutable variables}
-
-Mutable variables, for the @IO@ monad.
-
-\begin{code}
-module MutVar
-
-       (
-        MutVar,      -- abstract
-
-       newVar,      -- :: a -> IO (MutVar a)
-       readVar,     -- :: MutVar a -> IO a
-       writeVar,    -- :: MutVar a -> a -> IO ()
-       sameVar      -- :: MutVar a -> MutVar a -> Bool
-
-       ) where
-
-import qualified ST
-import qualified ArrBase
-import IOBase ( IO , stToIO )
-import GHC (RealWorld)
-
-\end{code}
-
-\begin{code}
-
-newtype MutVar a = MutVar (ArrBase.MutableVar RealWorld a)
-
-newVar :: a -> IO (MutVar a)
-newVar v = stToIO (ST.newVar v) >>= \ var -> return (MutVar var)
-
-readVar :: MutVar a -> IO a
-readVar (MutVar var) = stToIO (ST.readVar var)
-
-writeVar :: MutVar a -> a -> IO ()
-writeVar (MutVar var) v = stToIO (ST.writeVar var v)
-
-sameVar :: MutVar a -> MutVar a -> Bool
-sameVar (MutVar var1) (MutVar var2) = ST.sameVar var1 var2
-
-\end{code}
index d25dc83..3e5220f 100644 (file)
@@ -8,35 +8,27 @@
 
 module ST (
 
-       -- ToDo: review this interface; I'm avoiding gratuitous changes for now
-       --                      SLPJ Jan 97
-
-
        ST,
 
+       unsafeInterleaveST,
+
         -- ST is one, so you'll likely need some Monad bits
         module Monad,
 
-       thenST, seqST, returnST, listST, fixST, runST, unsafeInterleaveST,
-        mapST, mapAndUnzipST,
-         -- the lazy variant
-       -- returnLazyST, thenLazyST, seqLazyST,
+       STRef,
+       newSTRef, readSTRef, writeSTRef,
 
-       MutableVar,
-       newVar, readVar, writeVar, sameVar,
-
-       MutableArray,
-       newArray, readArray, writeArray, sameMutableArray
+       STArray,
+       newSTArray, readSTArray, writeSTArray, Ix
 
     ) where
 
-import IOBase  ( error )       -- [Source not needed]
 import ArrBase
+import Unsafe   ( unsafeInterleaveST )
 import STBase
-import UnsafeST        ( unsafeInterleaveST )
-import PrelBase        ( Int, Bool, ($), ()(..) )
-import GHC     ( newArray#, readArray#, writeArray#, sameMutableArray#, sameMutableByteArray# )
+import PrelBase        ( Eq(..), Int, Bool, ($), ()(..) )
 import Monad
+import Ix
 
 \end{code}
 
@@ -47,39 +39,41 @@ import Monad
 %*********************************************************
 
 \begin{code}
--- in ArrBase: type MutableVar s a = MutableArray s Int a
-
-newVar   :: a -> ST s (MutableVar s a)
-readVar  :: MutableVar s a -> ST s a
-writeVar :: MutableVar s a -> a -> ST s ()
-sameVar  :: MutableVar s a -> MutableVar s a -> Bool
-
-newVar init = ST $ \ s# ->
-    case (newArray# 1# init s#)     of { StateAndMutableArray# s2# arr# ->
-    STret s2# (MutableArray vAR_IXS arr#) }
-  where
-    vAR_IXS = error "newVar: Shouldn't access `bounds' of a MutableVar\n"
+newtype STRef s a = STRef (MutableVar s a) deriving Eq
 
-readVar (MutableArray _ var#) = ST $ \ s# ->
-    case readArray# var# 0# s# of { StateAndPtr# s2# r ->
-    STret s2# r }
+newSTRef :: a -> ST s (STRef s a)
+newSTRef v = newVar v >>= \ var -> return (STRef var)
 
-writeVar (MutableArray _ var#) val = ST $ \ s# ->
-    case writeArray# var# 0# val s# of { s2# ->
-    STret s2# () }
+readSTRef :: STRef s a -> ST s a
+readSTRef (STRef var) = readVar var
 
-sameVar (MutableArray _ var1#) (MutableArray _ var2#)
-  = sameMutableArray# var1# var2#
+writeSTRef :: STRef s a -> a -> ST s ()
+writeSTRef (STRef var) v = writeVar var v
 \end{code}
 
+%*********************************************************
+%*                                                     *
+\subsection{Arrays}
+%*                                                     *
+%*********************************************************
 
 \begin{code}
-sameMutableArray     :: MutableArray s ix elt -> MutableArray s ix elt -> Bool
-sameMutableByteArray :: MutableByteArray s ix -> MutableByteArray s ix -> Bool
-
-sameMutableArray (MutableArray _ arr1#) (MutableArray _ arr2#)
-  = sameMutableArray# arr1# arr2#
-
-sameMutableByteArray (MutableByteArray _ arr1#) (MutableByteArray _ arr2#)
-  = sameMutableByteArray# arr1# arr2#
+type STArray s ix elt = MutableArray s ix elt
+
+newSTArray             :: Ix ix => (ix,ix) -> elt -> ST s (STArray s ix elt)
+writeSTArray           :: Ix ix => STArray s ix elt -> ix -> elt -> ST s () 
+readSTArray            :: Ix ix => STArray s ix elt -> ix -> ST s elt 
+boundsSTArray          :: Ix ix => STArray s ix elt -> (ix, ix)  
+thawSTArray            :: Ix ix => Array ix elt -> ST s (STArray s ix elt)
+freezeSTArray          :: Ix ix => STArray s ix elt -> ST s (Array ix elt)
+unsafeFreezeSTArray    :: Ix ix => STArray s ix elt -> ST s (Array ix elt)
+
+newSTArray             = newArray
+boundsSTArray          = boundsOfArray
+readSTArray            = readArray
+writeSTArray           = writeArray
+thawSTArray            = thawArray
+freezeSTArray          = freezeArray
+unsafeFreezeSTArray    = unsafeFreezeArray
 \end{code}
+       
diff --git a/ghc/lib/glaExts/Word.lhs b/ghc/lib/glaExts/Word.lhs
new file mode 100644 (file)
index 0000000..98cef49
--- /dev/null
@@ -0,0 +1,354 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1996
+%
+
+\section[Word]{Module @Word@}
+
+This code is largely copied from the Hugs library of the same name.
+
+\begin{code}
+{-# OPTIONS -fno-implicit-prelude #-}
+
+module Word
+       ( Word8
+       , Word16
+       , Word32
+       , Word64
+       , word8ToWord32  -- :: Word8  -> Word32
+       , word32ToWord8  -- :: Word32 -> Word8
+       , word16ToWord32 -- :: Word16 -> Word32
+       , word32ToWord16 -- :: Word32 -> Word16
+       , word8ToInt     -- :: Word8  -> Int
+       , intToWord8     -- :: Int    -> Word8
+       , word16ToInt    -- :: Word16 -> Int
+       , intToWord16    -- :: Int    -> Word16
+       , word32ToInt    -- :: Word32 -> Int
+       , intToWord32    -- :: Int    -> Word32
+       ) where
+
+import PrelBase
+import PrelNum
+import PrelRead
+import Ix
+import Error
+import Bits
+import GHC
+
+-----------------------------------------------------------------------------
+-- The "official" coercion functions
+-----------------------------------------------------------------------------
+
+word8ToWord32  :: Word8  -> Word32
+word32ToWord8  :: Word32 -> Word8
+word16ToWord32 :: Word16 -> Word32
+word32ToWord16 :: Word32 -> Word16
+
+word8ToInt   :: Word8  -> Int
+intToWord8   :: Int    -> Word8
+word16ToInt  :: Word16 -> Int
+intToWord16  :: Int    -> Word16
+
+word8ToInt  = word32ToInt    . word8ToWord32
+intToWord8  = word32ToWord8  . intToWord32
+word16ToInt = word32ToInt    . word16ToWord32
+intToWord16 = word32ToWord16 . intToWord32
+
+intToWord32 (I# x)   = W32# (int2Word# x)
+word32ToInt (W32# x) = I#   (word2Int# x)
+
+-----------------------------------------------------------------------------
+-- Word8
+-----------------------------------------------------------------------------
+
+newtype Word8  = W8 Word32
+
+word8ToWord32 (W8 x) = x .&. 0xff
+word32ToWord8 = W8
+
+instance Eq  Word8     where (==)    = binop (==)
+instance Ord Word8     where compare = binop compare
+
+instance Num Word8 where
+    x + y         = to (binop (+) x y)
+    x - y         = to (binop (-) x y)
+    negate        = to . negate . from
+    x * y         = to (binop (*) x y)
+    abs           = absReal
+    signum        = signumReal
+    fromInteger   = to . integer2Word
+    fromInt       = intToWord8
+
+instance Bounded Word8 where
+    minBound = 0
+    maxBound = 0xff
+
+instance Real Word8 where
+    toRational x = toInteger x % 1
+
+instance Integral Word8 where
+    x `div` y     = to  (binop div x y)
+    x `quot` y    = to  (binop quot x y)
+    x `rem` y     = to  (binop rem x y)
+    x `mod` y     = to  (binop mod x y)
+    x `quotRem` y = to2 (binop quotRem x y)
+    divMod        = quotRem
+    toInteger     = toInteger . from
+    toInt         = word8ToInt
+
+instance Ix Word8 where
+    range (m,n)          = [m..n]
+    index b@(m,n) i
+          | inRange b i = word32ToInt (from (i - m))
+          | otherwise   = error "index: Index out of range"
+    inRange (m,n) i      = m <= i && i <= n
+
+instance Enum Word8 where
+    toEnum         = to . intToWord32
+    fromEnum       = word32ToInt . from
+    enumFrom c       = map toEnum [fromEnum c .. fromEnum (maxBound::Word8)]
+    enumFromThen c d = map toEnum [fromEnum c, fromEnum d .. fromEnum (last::Word8)]
+                      where last = if d < c then minBound else maxBound
+
+instance Read Word8 where
+    readsPrec p = readDec
+
+instance Show Word8 where
+    showsPrec p = showsPrec p . from
+
+instance Bits Word8 where
+  x .&. y       = to (binop (.&.) x y)
+  x .|. y       = to (binop (.|.) x y)
+  x `xor` y     = to (binop xor x y)
+  complement    = to . complement . from
+  x `shift` i   = to (from x `shift` i)
+--  rotate      
+  bit           = to . bit
+  setBit x i    = to (setBit (from x) i)
+  clearBit x i  = to (clearBit (from x) i)
+  complementBit x i = to (complementBit (from x) i)
+  testBit x i   = testBit (from x) i
+  bitSize  _    = 8
+  isSigned _    = False
+
+-----------------------------------------------------------------------------
+-- Word16
+-----------------------------------------------------------------------------
+
+newtype Word16 = W16 Word32
+
+word16ToWord32 (W16 x) = x .&. 0xffff
+word32ToWord16 = W16
+
+instance Eq  Word16     where (==)    = binop (==)
+instance Ord Word16     where compare = binop compare
+
+instance Num Word16 where
+    x + y         = to (binop (+) x y)
+    x - y         = to (binop (-) x y)
+    negate        = to . negate . from
+    x * y         = to (binop (*) x y)
+    abs           = absReal
+    signum        = signumReal
+    fromInteger   = to . integer2Word
+    fromInt       = intToWord16
+
+instance Bounded Word16 where
+    minBound = 0
+    maxBound = 0xffff
+
+instance Real Word16 where
+  toRational x = toInteger x % 1
+
+instance Integral Word16 where
+  x `div` y     = to  (binop div x y)
+  x `quot` y    = to  (binop quot x y)
+  x `rem` y     = to  (binop rem x y)
+  x `mod` y     = to  (binop mod x y)
+  x `quotRem` y = to2 (binop quotRem x y)
+  divMod        = quotRem
+  toInteger     = toInteger . from
+  toInt         = word16ToInt
+
+instance Ix Word16 where
+  range (m,n)          = [m..n]
+  index b@(m,n) i
+         | inRange b i = word32ToInt (from (i - m))
+         | otherwise   = error "index: Index out of range"
+  inRange (m,n) i      = m <= i && i <= n
+
+instance Enum Word16 where
+  toEnum         = to . intToWord32
+  fromEnum       = word32ToInt . from
+  enumFrom c       = map toEnum [fromEnum c .. fromEnum (maxBound::Word16)]
+  enumFromThen c d = map toEnum [fromEnum c, fromEnum d .. fromEnum (last::Word16)]
+                      where last = if d < c then minBound else maxBound
+
+instance Read Word16 where
+  readsPrec p = readDec
+
+instance Show Word16 where
+  showsPrec p x = showsPrec p (from x)
+
+instance Bits Word16 where
+  x .&. y       = to (binop (.&.) x y)
+  x .|. y       = to (binop (.|.) x y)
+  x `xor` y     = to (binop xor x y)
+  complement    = to . complement . from
+  x `shift` i   = to (from x `shift` i)
+--  rotate      
+  bit           = to . bit
+  setBit x i    = to (setBit (from x) i)
+  clearBit x i  = to (clearBit (from x) i)
+  complementBit x i = to (complementBit (from x) i)
+  testBit x i   = testBit (from x) i
+  bitSize  _    = 16
+  isSigned _    = False
+
+-----------------------------------------------------------------------------
+-- Word32
+-----------------------------------------------------------------------------
+
+data Word32 = W32# Word# deriving (Eq, Ord)
+
+instance Num Word32 where
+    (+) = intop (+)
+    (-) = intop (-)
+    (*) = intop (*)
+    negate (W32# x) = W32# (int2Word# (negateInt# (word2Int# x)))
+    abs             = absReal
+    signum          = signumReal
+    fromInteger     = integer2Word
+    fromInt (I# x)  = W32# (int2Word# x)
+
+{-# INLINE intop #-}
+intop op x y = intToWord32 (word32ToInt x `op` word32ToInt y)
+
+instance Bounded Word32 where
+    minBound = 0
+    maxBound = 0xffffffff
+
+instance Real Word32 where
+    toRational x = toInteger x % 1
+
+instance Integral Word32 where
+    x `div` y   = if x > 0 && y < 0    then quotWord (x-y-1) y
+                 else if x < 0 && y > 0        then quotWord (x-y+1) y
+                 else quotWord x y
+    quot       =  quotWord
+    rem                =  remWord
+    x `mod` y = if x > 0 && y < 0 || x < 0 && y > 0 then
+                   if r/=0 then r+y else 0
+               else
+                   r
+             where r = remWord x y
+    a `quotRem` b    = (a `quot` b, a `rem` b)
+    divMod x y       = (x `div` y,  x `mod` y)
+    toInteger (W32# x) = int2Integer# (word2Int# x)
+    toInt     (W32# x) = I# (word2Int# x)
+
+{-# INLINE quotWord #-}
+{-# INLINE remWord  #-}
+(W32# x) `quotWord` (W32# y) = 
+       W32# (int2Word# (word2Int# x `quotInt#` word2Int# y))
+(W32# x) `remWord`  (W32# y) = 
+       W32# (int2Word# (word2Int# x `remInt#`  word2Int# y))
+
+instance Ix Word32 where
+    range (m,n)          = [m..n]
+    index b@(m,n) i
+          | inRange b i = word32ToInt (i - m)
+          | otherwise   = error "index: Index out of range"
+    inRange (m,n) i      = m <= i && i <= n
+
+instance Enum Word32 where
+    toEnum        = intToWord32
+    fromEnum      = word32ToInt
+    enumFrom c       = map toEnum [fromEnum c .. fromEnum (maxBound::Word32)]
+    enumFromThen c d = map toEnum [fromEnum c, fromEnum d .. fromEnum (last::Word32)]
+                      where last = if d < c then minBound else maxBound
+
+instance Read Word32 where
+    readsPrec p = readDec
+
+instance Show Word32 where
+    showsPrec p x = showsPrec p (word32ToInt x)
+
+instance Bits Word32 where
+  (.&.)         = wordop and#
+  (.|.)         = wordop or#
+  xor           = wordop xor#
+  complement x  = (x `xor` maxBound) + 1
+  shift (W32# x) i@(I# i#)
+       | i > 0     = W32# (shiftL# x i#)
+       | otherwise = W32# (shiftRL# x (negateInt# i#))
+  --rotate
+  bit i             = 1 `shift` -i
+  setBit x i        = x .|. bit i
+  clearBit x i      = x .&. complement (bit i)
+  complementBit x i = x `xor` bit i
+  testBit x i       = (x .&. bit i) /= 0
+  bitSize  _        = 32
+  isSigned _        = False
+
+{-# INLINE wordop #-}
+wordop op (W32# x) (W32# y) = W32# (x `op` y)
+
+-----------------------------------------------------------------------------
+-- Word64
+-----------------------------------------------------------------------------
+
+data Word64 = W64 {lo,hi::Word32} deriving (Eq, Ord, Bounded)
+
+w64ToInteger W64{lo,hi} = toInteger lo + 0x100000000 * toInteger hi 
+integerToW64 x = case x `quotRem` 0x100000000 of 
+                 (h,l) -> W64{lo=fromInteger l, hi=fromInteger h}
+
+instance Show Word64 where
+  showsPrec p x = showsPrec p (w64ToInteger x)
+
+instance Read Word64 where
+  readsPrec p s = [ (integerToW64 x,r) | (x,r) <- readDec s ]
+
+-----------------------------------------------------------------------------
+-- End of exported definitions
+--
+-- The remainder of this file consists of definitions which are only
+-- used in the implementation.
+-----------------------------------------------------------------------------
+
+-----------------------------------------------------------------------------
+-- Coercions - used to make the instance declarations more uniform
+-----------------------------------------------------------------------------
+
+class Coerce a where
+  to   :: Word32 -> a
+  from :: a -> Word32
+
+instance Coerce Word8 where
+  from = word8ToWord32
+  to   = word32ToWord8
+
+instance Coerce Word16 where
+  from = word16ToWord32
+  to   = word32ToWord16
+
+binop :: Coerce word => (Word32 -> Word32 -> a) -> (word -> word -> a)
+binop op x y = from x `op` from y
+
+to2 :: Coerce word => (Word32, Word32) -> (word, word)
+to2 (x,y) = (to x, to y)
+
+integer2Word (J# a# s# d#) = W32# (int2Word# (integer2Int# a# s# d#))
+
+-----------------------------------------------------------------------------
+-- Code copied from the Prelude
+-----------------------------------------------------------------------------
+
+absReal x    | x >= 0    = x
+            | otherwise = -x
+
+signumReal x | x == 0    =  0
+            | x > 0     =  1
+            | otherwise = -1
+
+\end{code}
index 9968f74..97ff7df 100644 (file)
@@ -12,11 +12,11 @@ module CPUTime
 
 import PrelBase ( Int(..), indexIntArray# )
 import ArrBase  ( ByteArray(..), newIntArray, unsafeFreezeByteArray )
-import Foreign ( Addr )
+import Addr
 import IOBase
 import IO
+import Unsafe   ( unsafePerformIO )
 import STBase
-import UnsafeST        ( unsafePerformPrimIO )
 import Ratio
 
 \end{code}
@@ -30,21 +30,22 @@ the number of
 
 \begin{code}
 getCPUTime :: IO Integer
-getCPUTime =
-    newIntArray (0,3)                      `thenIO_Prim` \ marr ->
-    unsafeFreezeByteArray marr             `thenIO_Prim` \ barr@(ByteArray _ frozen#) ->
-    _ccall_ getCPUTime barr                `thenIO_Prim` \ ptr ->
+getCPUTime = 
+    stToIO (newIntArray (0,3))         >>= \ marr ->
+    stToIO (unsafeFreezeByteArray marr)        >>= \ barr@(ByteArray _ frozen#) ->
+    _ccall_ getCPUTime barr            >>= \ ptr ->
     if (ptr::Addr) /= ``NULL'' then
         return ((fromIntegral (I# (indexIntArray# frozen# 0#)) * 1000000000 + 
                 fromIntegral (I# (indexIntArray# frozen# 1#)) + 
                fromIntegral (I# (indexIntArray# frozen# 2#)) * 1000000000 + 
                 fromIntegral (I# (indexIntArray# frozen# 3#))) * 1000)
     else
-       fail (IOError Nothing UnsupportedOperation "getCPUTime: can't get CPU time")
+       fail (IOError Nothing UnsupportedOperation 
+               "getCPUTime: can't get CPU time")
 
 cpuTimePrecision :: Integer
 cpuTimePrecision = round ((1000000000000::Integer) % 
-                          fromInt (unsafePerformPrimIO (_ccall_ clockTicks )))
+                          fromInt (unsafePerformIO (_ccall_ clockTicks )))
 \end{code}
 
 
index 3df0bee..40ba72d 100644 (file)
@@ -27,7 +27,7 @@ module Char
 
 import PrelBase
 import PrelRead (readLitChar)
-import IOBase   (error)
+import Error    ( error )
 
 \end{code}
 
index d633b4a..0389cbb 100644 (file)
@@ -40,10 +40,11 @@ module Directory
    ) where
 
 import PrelBase
-import Foreign
+import Foreign         ( Word(..) )
+import Addr
 import IOBase
 import STBase
-import UnsafeST                ( unsafePerformPrimIO )
+import Unsafe          ( unsafePerformIO )
 import ArrBase
 import PackBase                ( unpackNBytesST )
 import Time             ( ClockTime(..) )
@@ -129,11 +130,9 @@ The path refers to an existing non-directory object.
 \end{itemize}
 
 \begin{code}
-createDirectory path =
-    _ccall_ createDirectory path    `thenIO_Prim` \ rc ->
-    if rc == 0 then
-        return ()
-    else
+createDirectory path = do
+    rc <- _ccall_ createDirectory path
+    if rc == 0 then return () else
         constructErrorAndFail "createDirectory"
 \end{code}
 
@@ -172,11 +171,11 @@ The operand refers to an existing non-directory object.
 \end{itemize}
 
 \begin{code}
-removeDirectory path =
-    _ccall_ removeDirectory path    `thenIO_Prim` \ rc ->
-    if rc == 0 then
-        return ()
-    else
+removeDirectory path = do
+    rc <- _ccall_ removeDirectory path
+    if rc == 0 then 
+       return ()
+     else 
         constructErrorAndFail "removeDirectory"
 \end{code}
 
@@ -209,11 +208,11 @@ The operand refers to an existing directory.
 \end{itemize}
 
 \begin{code}
-removeFile path =
-    _ccall_ removeFile path `thenIO_Prim` \ rc ->
+removeFile path = do
+    rc <- _ccall_ removeFile path
     if rc == 0 then
         return ()
-    else
+     else
         constructErrorAndFail "removeFile"
 \end{code}
 
@@ -256,11 +255,11 @@ Either path refers to an existing non-directory object.
 \end{itemize}
 
 \begin{code}
-renameDirectory opath npath =
-    _ccall_ renameDirectory opath npath        `thenIO_Prim` \ rc ->
+renameDirectory opath npath = do
+    rc <- _ccall_ renameDirectory opath npath
     if rc == 0 then
         return ()
-    else
+     else
         constructErrorAndFail "renameDirectory"
 \end{code}
 
@@ -301,11 +300,11 @@ Either path refers to an existing directory.
 \end{itemize}
 
 \begin{code}
-renameFile opath npath =
-    _ccall_ renameFile opath npath  `thenIO_Prim` \ rc ->
+renameFile opath npath = do
+    rc <- _ccall_ renameFile opath npath
     if rc == 0 then
         return ()
-    else
+     else
         constructErrorAndFail  "renameFile"
 \end{code}
 
@@ -335,26 +334,26 @@ The path refers to an existing non-directory object.
 \end{itemize}
 
 \begin{code}
-getDirectoryContents path =
-    _ccall_ getDirectoryContents path  `thenIO_Prim` \ ptr ->
-    if ptr == ``NULL'' then
-        constructErrorAndFail "getDirectoryContents"
-    else
-       stToIO (getEntries ptr 0)       >>= \ entries ->
-       _ccall_ free ptr                `thenIO_Prim` \ () ->
-       return entries
+getDirectoryContents path = do
+    ptr <- _ccall_ getDirectoryContents path
+    if ptr == ``NULL'' 
+       then constructErrorAndFail "getDirectoryContents"
+       else do
+               entries <- getEntries ptr 0
+               _ccall_ free ptr
+               return entries
   where
-    getEntries :: Addr -> Int -> PrimIO [FilePath]
-    getEntries ptr n =
-        _casm_ ``%r = ((char **)%0)[%1];'' ptr n    >>= \ str ->
-        if str == ``NULL'' then 
-            return []
-        else
-            _ccall_ strlen str                     >>= \ len ->
-           unpackNBytesST str len                  >>= \ entry ->
-            _ccall_ free str                       >>= \ () ->
-            getEntries ptr (n+1)                   >>= \ entries ->
-           return (entry : entries)
+    getEntries :: Addr -> Int -> IO [FilePath]
+    getEntries ptr n = do
+        str <- _casm_ ``%r = ((char **)%0)[%1];'' ptr n
+        if str == ``NULL'' 
+           then return []
+            else do
+               len <- _ccall_ strlen str
+               entry <- stToIO (unpackNBytesST str len)
+               _ccall_ free str
+               entries <- getEntries ptr (n+1)
+               return (entry : entries)
 \end{code}
 
 If the operating system has a notion of current directories,
@@ -379,15 +378,16 @@ The operating system has no notion of current directory.
 \end{itemize}
 
 \begin{code}
-getCurrentDirectory =
-    _ccall_ getCurrentDirectory            `thenIO_Prim` \ str ->
-    if str /= ``NULL'' then
-        _ccall_ strlen str             `thenIO_Prim` \ len ->
-        stToIO (unpackNBytesST str len)        >>=           \ pwd ->
-        _ccall_ free str               `thenIO_Prim` \ () ->
-        return pwd
-    else
-        constructErrorAndFail "getCurrentDirectory"
+getCurrentDirectory = do
+    str <- _ccall_ getCurrentDirectory
+    if str /= ``NULL'' 
+       then do
+            len <- _ccall_ strlen str
+            pwd <- stToIO (unpackNBytesST str len)
+            _ccall_ free str
+            return pwd
+       else
+            constructErrorAndFail "getCurrentDirectory"
 \end{code}
 
 If the operating system has a notion of current directories,
@@ -417,20 +417,18 @@ The path refers to an existing non-directory object.
 \end{itemize}
 
 \begin{code}
-setCurrentDirectory path =
-    _ccall_ setCurrentDirectory path   `thenIO_Prim` \ rc ->
-    if rc == 0 then
-        return ()
-    else
-        constructErrorAndFail "setCurrentDirectory"
+setCurrentDirectory path = do
+    rc <- _ccall_ setCurrentDirectory path
+    if rc == 0 
+       then return ()
+       else constructErrorAndFail "setCurrentDirectory"
 \end{code}
 
 
-
 \begin{code}
 --doesFileExist :: FilePath -> IO Bool
-doesFileExist name =
-  _ccall_ access name (``F_OK''::Int)      `thenIO_Prim` \ rc ->
+doesFileExist name = do 
+  rc <- _ccall_ access name (``F_OK''::Int)
   return (rc == 0)
 
 --doesDirectoryExist :: FilePath -> IO Bool
@@ -461,19 +459,18 @@ getPermissions name =
   )
 
 --setPermissions :: FilePath -> Permissions -> IO ()
-setPermissions name (Permissions r w e s) = 
+setPermissions name (Permissions r w e s) = do
     let
      read#  = case (if r then ownerReadMode else ``0'') of { W# x# -> x# }
      write# = case (if w then ownerWriteMode else ``0'') of { W# x# -> x# }
      exec#  = case (if e || s then ownerExecuteMode else ``0'') of { W# x# -> x# }
 
      mode  = I# (word2Int# (read# `or#` write# `or#` exec#))
-    in
-    _ccall_ chmod name mode                        `thenIO_Prim` \ rc ->
-    if rc == 0 then
-       return ()
-    else
-       fail (IOError Nothing SystemError "Directory.setPermissions")
+
+    rc <- _ccall_ chmod name mode
+    if rc == 0
+       then return ()
+       else fail (IOError Nothing SystemError "Directory.setPermissions")
 
 \end{code}
 
@@ -484,27 +481,24 @@ setPermissions name (Permissions r w e s) =
 type FileStatus = ByteArray Int
 
 getFileStatus :: FilePath -> IO FileStatus
-getFileStatus name =
-    newCharArray (0,``sizeof(struct stat)'')        `thenIO_Prim` \ bytes ->
-    _casm_ ``%r = stat(%0,(struct stat *)%1);'' name bytes
-                                                   `thenIO_Prim` \ rc ->
-    if rc == 0 then
-       unsafeFreezeByteArray bytes                 `thenIO_Prim` \ stat ->
-       return stat
-    else
-       fail (IOError Nothing SystemError "Directory.getFileStatus")
+getFileStatus name = do
+    bytes <- stToIO (newCharArray (0,``sizeof(struct stat)''))
+    rc <- _casm_ ``%r = stat(%0,(struct stat *)%1);'' name bytes
+    if rc == 0 
+       then stToIO (unsafeFreezeByteArray bytes)
+       else fail (IOError Nothing SystemError "Directory.getFileStatus")
 
 modificationTime :: FileStatus -> IO ClockTime
-modificationTime stat =
-    malloc1                                               `thenIO_Prim` \ i1 ->
-    _casm_ ``((unsigned long *)%1)[0] = ((struct stat *)%0)->st_mtime;'' stat i1 `thenIO_Prim` \ () ->
-    cvtUnsigned i1                                         `thenIO_Prim` \ secs ->
+modificationTime stat = do
+    i1 <- malloc1
+    _casm_ ``((unsigned long *)%1)[0] = ((struct stat *)%0)->st_mtime;'' stat i1
+    secs <- cvtUnsigned i1
     return (TOD secs 0)
   where
-    malloc1 = ST $ \ s# ->
+    malloc1 = IO $ \ s# ->
        case newIntArray# 1# s# of 
           StateAndMutableByteArray# s2# barr# -> 
-               STret s2# (MutableByteArray bnds barr#)
+               IOok s2# (MutableByteArray bnds barr#)
 
     bnds = (0,1)
     -- The C routine fills in an unsigned word.  We don't have `unsigned2Integer#,'
@@ -512,27 +506,25 @@ modificationTime stat =
     -- zero is still handled specially, although (J# 1# 1# (ptr to 0#)) is probably
     -- acceptable to gmp.
 
-    cvtUnsigned (MutableByteArray _ arr#) = ST $ \ s# ->
+    cvtUnsigned (MutableByteArray _ arr#) = IO $ \ s# ->
        case readIntArray# arr# 0# s# of 
          StateAndInt# s2# r# ->
             if r# ==# 0# then
-                STret s2# 0
+                IOok s2# 0
             else
                 case unsafeFreezeByteArray# arr# s2# of
                   StateAndByteArray# s3# frozen# -> 
-                       STret s3# (J# 1# 1# frozen#)
+                       IOok s3# (J# 1# 1# frozen#)
 
 isDirectory :: FileStatus -> Bool
-isDirectory stat = unsafePerformPrimIO $
-    _casm_ ``%r = S_ISDIR(((struct stat *)%0)->st_mode);'' stat >>= \ rc ->
+isDirectory stat = unsafePerformIO $ do
+    rc <- _casm_ ``%r = S_ISDIR(((struct stat *)%0)->st_mode);'' stat
     return (rc /= 0)
 
 isRegularFile :: FileStatus -> Bool
-isRegularFile stat = unsafePerformPrimIO $
-    _casm_ ``%r = S_ISREG(((struct stat *)%0)->st_mode);'' stat >>= \ rc ->
+isRegularFile stat = unsafePerformIO $ do
+    rc <- _casm_ ``%r = S_ISREG(((struct stat *)%0)->st_mode);'' stat
     return (rc /= 0)
-
-
 \end{code}
 
 \begin{code}
@@ -550,8 +542,7 @@ intersectFileMode :: FileMode -> FileMode -> FileMode
 intersectFileMode (W# m1#) (W# m2#) = W# (m1# `and#` m2#)
 
 fileMode :: FileStatus -> FileMode
-fileMode stat = unsafePerformPrimIO $
-    _casm_ ``%r = ((struct stat *)%0)->st_mode;'' stat >>= \ mode ->
-    return mode
+fileMode stat = unsafePerformIO (
+       _casm_ ``%r = ((struct stat *)%0)->st_mode;'' stat)
 
 \end{code}
index 25767d5..abf28ec 100644 (file)
@@ -34,18 +34,18 @@ module IO (
 
 import Ix
 import STBase
-import UnsafeST                ( unsafePerformPrimIO, unsafeInterleavePrimIO )
+import Unsafe          ( unsafePerformIO, unsafeInterleaveIO )
 import IOBase
 import ArrBase         ( MutableByteArray(..), newCharArray )
 import IOHandle                -- much of the real stuff is in here
 import PackBase                ( unpackNBytesST )
 import PrelBase
 import GHC
-import Foreign  ( Addr, 
+import Addr
+
 #ifndef __PARALLEL_HASKELL__
-                  ForeignObj, makeForeignObj, writeForeignObj 
+import Foreign  ( ForeignObj, makeForeignObj, writeForeignObj )
 #endif
-                 )
 
 import Char            ( ord, chr )
 \end{code}
@@ -105,11 +105,11 @@ instance Eq IOError where
 
 instance Eq Handle where
  h1 == h2 =
-  unsafePerformPrimIO (
-    ioToPrimIO (readHandle h1)      >>= \ h1_ ->
-    ioToPrimIO (writeHandle h1 h1_) >>
-    ioToPrimIO (readHandle h2)      >>= \ h2_ ->
-    ioToPrimIO (writeHandle h2 h2_) >>
+  unsafePerformIO (do
+    h1_ <- readHandle h1
+    writeHandle h1 h1_
+    h2_<- readHandle h2
+    writeHandle h2 h2_
     return (
      case (h1_,h2_) of
       (ErrorHandle (IOError h1 _ _), ErrorHandle (IOError h2 _ _)) -> h1 == h2
@@ -146,27 +146,29 @@ before deciding whether the Handle has run dry or not.
 hReady h = hWaitForInput h 0
 
 --hWaitForInput :: Handle -> Int -> IO Bool 
-hWaitForInput handle nsecs = 
-    readHandle handle                              >>= \ htype ->
+hWaitForInput handle nsecs = do
+    htype <- readHandle handle
     case htype of 
-      ErrorHandle ioError ->
-         writeHandle handle htype                  >>
+      ErrorHandle ioError -> do
+         writeHandle handle htype
           fail ioError
-      ClosedHandle ->
-         writeHandle handle htype                  >>
+      ClosedHandle -> do
+         writeHandle handle htype
          ioe_closedHandle handle
-      SemiClosedHandle _ _ ->
-         writeHandle handle htype                  >>
+      SemiClosedHandle _ _ -> do
+         writeHandle handle htype
          ioe_closedHandle handle
-      AppendHandle _ _ _ ->
-         writeHandle handle htype                  >>
-         fail (IOError (Just handle) IllegalOperation "handle is not open for reading")
-      WriteHandle _ _ _ ->
-         writeHandle handle htype                  >>
-         fail (IOError (Just handle) IllegalOperation "handle is not open for reading")
-      other -> 
-         _ccall_ inputReady (filePtr other) nsecs  `thenIO_Prim` \ rc ->
-         writeHandle handle (markHandle htype)     >>
+      AppendHandle _ _ _ -> do
+         writeHandle handle htype
+         fail (IOError (Just handle) IllegalOperation 
+               "handle is not open for reading")
+      WriteHandle _ _ _ -> do
+         writeHandle handle htype
+         fail (IOError (Just handle) IllegalOperation  
+               "handle is not open for reading")
+      other -> do
+         rc <- _ccall_ inputReady (filePtr other) nsecs
+         writeHandle handle (markHandle htype)
           case rc of
             0 -> return False
             1 -> return True
@@ -179,8 +181,8 @@ Computation $hGetChar hdl$ reads the next character from handle
 \begin{code}
 --hGetChar :: Handle -> IO Char
 
-hGetChar handle = 
-    readHandle handle                              >>= \ htype ->
+hGetChar handle = do
+    htype <- readHandle handle
     case htype of 
       ErrorHandle ioError ->
          writeHandle handle htype                  >>
@@ -197,12 +199,12 @@ hGetChar handle =
       WriteHandle _ _ _ ->
          writeHandle handle htype                  >>
          fail (IOError (Just handle) IllegalOperation "handle is not open for reading")
-      other -> 
-         _ccall_ fileGetc (filePtr other)          `thenIO_Prim` \ intc ->
-         writeHandle handle (markHandle htype)   >>
+      other -> do
+         intc <- _ccall_ fileGetc (filePtr other)
+         writeHandle handle (markHandle htype)
           if intc /= ``EOF'' then
               return (chr intc)
-          else
+           else
               constructErrorAndFail "hGetChar"
 
 hGetLine :: Handle -> IO String
@@ -239,12 +241,12 @@ hLookAhead handle =
       WriteHandle _ _ _ ->
          writeHandle handle htype                  >>
          fail (IOError (Just handle) IllegalOperation "handle is not open for reading")
-      other -> 
-         _ccall_ fileLookAhead (filePtr other)    `thenIO_Prim` \ intc ->
-         writeHandle handle (markHandle htype)   >>
+      other -> do
+         intc <- _ccall_ fileLookAhead (filePtr other)
+         writeHandle handle (markHandle htype)
           if intc /= ``EOF'' then
               return (chr intc)
-          else
+           else
               constructErrorAndFail "hLookAhead"
 \end{code}
 
@@ -286,33 +288,32 @@ hGetContents handle =
              we provide three lazy read methods, based on character,
              line, and block buffering.
           -}
-         stToIO (getBufferMode other)  >>= \ other ->
+         getBufferMode other   >>= \ other ->
           case (bufferMode other) of
             Just LineBuffering ->
                allocBuf Nothing                    >>= \ buf_info ->
                writeHandle handle (SemiClosedHandle (filePtr other) buf_info)
                                                    >>
-                unsafeInterleavePrimIO (lazyReadLine handle)
-                                                   `thenIO_Prim` \ contents ->
+                unsafeInterleaveIO (lazyReadLine handle)
+                                                   >>= \ contents ->
                return contents
 
             Just (BlockBuffering size) ->
                allocBuf size                       >>= \ buf_info ->
                writeHandle handle (SemiClosedHandle (filePtr other) buf_info)
                                                    >>
-                unsafeInterleavePrimIO (lazyReadBlock handle)
-                                                   `thenIO_Prim` \ contents ->
+                unsafeInterleaveIO (lazyReadBlock handle)
+                                                   >>= \ contents ->
                return contents
             _ -> -- Nothing is treated pessimistically as NoBuffering
                writeHandle handle (SemiClosedHandle (filePtr other) (``NULL'', 0))
                                                    >>
-                unsafeInterleavePrimIO (lazyReadChar handle)
-                                                   `thenIO_Prim` \ contents ->
+                unsafeInterleaveIO (lazyReadChar handle) >>= \ contents ->
                return contents
   where
     allocBuf :: Maybe Int -> IO (Addr, Int)
     allocBuf msize =
-       _ccall_ malloc size                         `thenIO_Prim` \ buf ->
+       _ccall_ malloc size                         >>= \ buf ->
        if buf /= ``NULL'' then
            return (buf, size)
        else
@@ -329,89 +330,87 @@ the same FILE * for something else.  Therefore, we have to re-examine the
 handle every time through.
 
 \begin{code}
-lazyReadBlock :: Handle -> PrimIO String
-lazyReadLine  :: Handle -> PrimIO String
-lazyReadChar  :: Handle -> PrimIO String
+lazyReadBlock :: Handle -> IO String
+lazyReadLine  :: Handle -> IO String
+lazyReadChar  :: Handle -> IO String
 
 lazyReadBlock handle =
-    ioToST (readHandle handle)                  >>= \ htype ->
+    readHandle handle                            >>= \ htype ->
     case htype of 
       -- There cannae be an ErrorHandle here
       ClosedHandle ->
-         ioToST (writeHandle handle htype)     >>
-         returnPrimIO ""
+         writeHandle handle htype                  >>
+         return ""
       SemiClosedHandle fp (buf, size) ->
          _ccall_ readBlock buf fp size             >>= \ bytes ->
          (if bytes <= 0
          then return ""
-         else unpackNBytesST buf bytes)            >>= \ some ->
+         else stToIO (unpackNBytesST buf bytes))   >>= \ some ->
           if bytes < 0 then
               _ccall_ free buf                     >>= \ () ->
               _ccall_ closeFile fp                 >>
 #ifndef __PARALLEL_HASKELL__
              writeForeignObj fp ``NULL''           >>
-             ioToST (writeHandle handle (SemiClosedHandle fp (``NULL'', 0))) >>
+             writeHandle handle (SemiClosedHandle fp (``NULL'', 0)) >>
 #else
-             ioToST (writeHandle handle (SemiClosedHandle ``NULL'' (``NULL'', 0))) >>
+             writeHandle handle (SemiClosedHandle ``NULL'' (``NULL'', 0)) >>
 #endif
-             returnPrimIO some
+             return some
          else
-             ioToST (writeHandle handle htype)     >>
-              unsafeInterleavePrimIO (lazyReadBlock handle)
-                                                   >>= \ more ->
-             returnPrimIO (some ++ more)
+             writeHandle handle htype      >>
+              unsafeInterleaveIO (lazyReadBlock handle)  >>= \ more ->
+             return (some ++ more)
 
 lazyReadLine handle =
-    ioToST (readHandle handle)                      >>= \ htype ->
+    readHandle handle                              >>= \ htype ->
     case htype of 
       -- There cannae be an ErrorHandle here
       ClosedHandle ->
-         ioToST (writeHandle handle htype) >>
-         returnPrimIO ""
+         writeHandle handle htype >>
+         return ""
       SemiClosedHandle fp (buf, size) ->
          _ccall_ readLine buf fp size              >>= \ bytes ->
          (if bytes <= 0
          then return ""
-         else unpackNBytesST buf bytes)            >>= \ some ->
+         else stToIO (unpackNBytesST buf bytes))   >>= \ some ->
           if bytes < 0 then
               _ccall_ free buf                     >>= \ () ->
               _ccall_ closeFile fp                 >>
 #ifndef __PARALLEL_HASKELL__
              writeForeignObj fp ``NULL''           >>
-             ioToST (writeHandle handle (SemiClosedHandle fp (``NULL'', 0))) >>
+             writeHandle handle (SemiClosedHandle fp (``NULL'', 0)) >>
 #else
-             ioToST (writeHandle handle (SemiClosedHandle ``NULL'' (``NULL'', 0))) >>
+             writeHandle handle (SemiClosedHandle ``NULL'' (``NULL'', 0)) >>
 #endif
              return some
          else
-             ioToST (writeHandle handle htype)     >>
-              unsafeInterleavePrimIO (lazyReadLine handle)
+             writeHandle handle htype      >>
+              unsafeInterleaveIO (lazyReadLine handle)
                                                    >>= \ more ->
              return (some ++ more)
 
 lazyReadChar handle =
-    ioToST (readHandle handle)                      >>= \ htype ->
+    readHandle handle                              >>= \ htype ->
     case htype of 
       -- There cannae be an ErrorHandle here
       ClosedHandle ->
-         ioToST (writeHandle handle htype)         >>
-         returnPrimIO ""
+         writeHandle handle htype                  >>
+         return ""
       SemiClosedHandle fp buf_info ->
          _ccall_ readChar fp                       >>= \ char ->
           if char == ``EOF'' then
               _ccall_ closeFile fp                 >>
 #ifndef __PARALLEL_HASKELL__
              writeForeignObj fp ``NULL''           >>
-             ioToST (writeHandle handle (SemiClosedHandle fp (``NULL'', 0))) >>
+             writeHandle handle (SemiClosedHandle fp (``NULL'', 0)) >>
 #else
-             ioToST (writeHandle handle (SemiClosedHandle ``NULL'' (``NULL'', 0))) >>
+             writeHandle handle (SemiClosedHandle ``NULL'' (``NULL'', 0)) >>
 #endif
-             returnPrimIO ""
+             return ""
          else
-             ioToST (writeHandle handle htype)     >>
-              unsafeInterleavePrimIO (lazyReadChar handle)
-                                                   >>= \ more ->
-             returnPrimIO (chr char : more)
+             writeHandle handle htype              >>
+              unsafeInterleaveIO (lazyReadChar handle) >>= \ more ->
+             return (chr char : more)
 
 \end{code}
 
@@ -445,7 +444,7 @@ hPutChar handle c =
          writeHandle handle htype                  >>
          fail (IOError (Just handle) IllegalOperation "handle is not open for writing")
       other -> 
-         _ccall_ filePutc (filePtr other) (ord c) `thenIO_Prim` \ rc ->
+         _ccall_ filePutc (filePtr other) (ord c) >>= \ rc ->
          writeHandle handle (markHandle htype)   >>
           if rc == 0 then
               return ()
@@ -485,7 +484,7 @@ hPutStr handle str =
 
           ToDo: fix me
          -}
-          getBufferMode other                      `thenIO_Prim` \ other ->
+          getBufferMode other                      >>= \ other ->
           (case bufferMode other of
             Just LineBuffering ->
                writeChars (filePtr other) str
@@ -496,7 +495,7 @@ hPutStr handle str =
                writeBlocks (filePtr other) ``BUFSIZ'' str
             _ -> -- Nothing is treated pessimistically as NoBuffering
                writeChars (filePtr other) str
-         )                                         `thenIO_Prim` \ success ->
+         )                                         >>= \ success ->
          writeHandle handle (markHandle other) >>
           if success then
               return ()
@@ -504,16 +503,16 @@ hPutStr handle str =
               constructErrorAndFail "hPutStr"
   where
 #ifndef __PARALLEL_HASKELL__
-    writeLines :: ForeignObj -> String -> PrimIO Bool
+    writeLines :: ForeignObj -> String -> IO Bool
 #else
-    writeLines :: Addr -> String -> PrimIO Bool
+    writeLines :: Addr -> String -> IO Bool
 #endif
     writeLines = writeChunks ``BUFSIZ'' True 
 
 #ifndef __PARALLEL_HASKELL__
-    writeBlocks :: ForeignObj -> Int -> String -> PrimIO Bool
+    writeBlocks :: ForeignObj -> Int -> String -> IO Bool
 #else
-    writeBlocks :: Addr -> Int -> String -> PrimIO Bool
+    writeBlocks :: Addr -> Int -> String -> IO Bool
 #endif
     writeBlocks fp size s = writeChunks size False fp s
  
@@ -530,27 +529,27 @@ hPutStr handle str =
     -}
 
 #ifndef __PARALLEL_HASKELL__
-    writeChunks :: Int -> Bool -> ForeignObj -> String -> PrimIO Bool
+    writeChunks :: Int -> Bool -> ForeignObj -> String -> IO Bool
 #else
-    writeChunks :: Int -> Bool -> Addr -> String -> PrimIO Bool
+    writeChunks :: Int -> Bool -> Addr -> String -> IO Bool
 #endif
     writeChunks (I# bufLen) chopOnNewLine fp s =
-     newCharArray (0,I# bufLen) >>= \ arr@(MutableByteArray _ arr#) ->
+     stToIO (newCharArray (0,I# bufLen)) >>= \ arr@(MutableByteArray _ arr#) ->
      let
-      write_char :: MutableByteArray# RealWorld -> Int# -> Char# -> PrimIO ()
-      write_char arr# n x = ST $ \ s# ->
+      write_char :: MutableByteArray# RealWorld -> Int# -> Char# -> IO ()
+      write_char arr# n x = IO $ \ s# ->
          case (writeCharArray# arr# n x s#) of { s1# ->
-         STret s1# () }
+         IOok s1# () }
 
-      shoveString :: Int# -> [Char] -> PrimIO Bool
+      shoveString :: Int# -> [Char] -> IO Bool
       shoveString n ls = 
        case ls of
          [] ->   
           if n ==# 0# then
-             returnPrimIO True
+             return True
           else
              _ccall_ writeFile arr fp (I# n) >>= \rc ->
-             returnPrimIO (rc==0)
+             return (rc==0)
 
          ((C# x):xs) ->
           write_char arr# n x  >>
@@ -568,17 +567,17 @@ hPutStr handle str =
      shoveString 0# s
 
 #ifndef __PARALLEL_HASKELL__
-    writeChars :: ForeignObj -> String -> PrimIO Bool
+    writeChars :: ForeignObj -> String -> IO Bool
 #else
-    writeChars :: Addr -> String -> PrimIO Bool
+    writeChars :: Addr -> String -> IO Bool
 #endif
-    writeChars fp "" = returnPrimIO True
+    writeChars fp "" = return True
     writeChars fp (c:cs) =
        _ccall_ filePutc fp (ord c) >>= \ rc ->
         if rc == 0 then
            writeChars fp cs
        else
-           returnPrimIO False
+           return False
 \end{code}
 
 Computation $hPrint hdl t$ writes the string representation of {\em t}
index 0da9e1a..65d32e7 100644 (file)
@@ -13,7 +13,7 @@ module Ix
        rangeSize
     ) where
 
-import {-# SOURCE #-}  IOBase  ( error )
+import {-# SOURCE #-} Error ( error )
 import PrelTup
 import PrelBase
 \end{code}
index bd9d1b9..2c663aa 100644 (file)
@@ -20,7 +20,7 @@ module Maybe
     unfoldr
    ) where
 
-import IOBase  ( error )
+import Error   ( error )
 import Monad   ( filter )
 import PrelList
 import PrelBase
index 7556c0a..088bc2b 100644 (file)
@@ -30,7 +30,7 @@ module Prelude (
     
     id, const, (.), flip, ($), until, asTypeOf, undefined,
 
-       -- From IOBase
+       -- From Error
     error,
 
        -- From Monad
@@ -69,7 +69,7 @@ import PrelNum
 import PrelTup
 import Monad
 import Maybe
-import IOBase  ( error )
+import Error   ( error )
 import GHCerr
 
 -- These can't conveniently be defined in PrelBase because they use numbers,
index 75d1fc7..806442e 100644 (file)
@@ -11,8 +11,8 @@ module System (
   ) where
 
 import Prelude
-import Foreign         ( Addr )
-import IOBase          ( IOError(..), IOErrorType(..), thenIO_Prim, constructErrorAndFail )
+import Addr
+import IOBase          ( IOError(..), IOErrorType(..), constructErrorAndFail )
 import ArrBase         ( indexAddrOffAddr )
 import PackBase        ( unpackCString )
 
@@ -76,12 +76,12 @@ The environment variable does not exist.
 \end{itemize}
 
 \begin{code}
-getEnv name = 
-    _ccall_ getenv name        `thenIO_Prim` \ litstring ->
-    if litstring /= ``NULL'' then
-       return (unpackCString litstring)
-    else
-       fail (IOError Nothing NoSuchThing ("environment variable: " ++ name))
+getEnv name = do
+    litstring <- _ccall_ getenv name
+    if litstring /= ``NULL'' 
+       then return (unpackCString litstring)
+        else fail (IOError Nothing NoSuchThing 
+                       ("environment variable: " ++ name))
 \end{code}
 
 Computation $system cmd$ returns the exit code
@@ -99,8 +99,8 @@ The implementation does not support system calls.
 
 \begin{code}
 system "" = fail (IOError Nothing InvalidArgument "null command")
-system cmd = 
-    _ccall_ systemCmd cmd      `thenIO_Prim` \ status ->
+system cmd = do
+    status <- _ccall_ systemCmd cmd
     case status of
         0  -> return ExitSuccess
         -1 -> constructErrorAndFail "system"
@@ -113,14 +113,14 @@ program, returning {\em code} to the program's caller.
 Before it terminates, any open or semi-closed handles are first closed.
 
 \begin{code}
-exitWith ExitSuccess = 
-    _ccall_ EXIT (0::Int)      `thenIO_Prim` \ () ->
+exitWith ExitSuccess = do
+    _ccall_ EXIT (0::Int)
     fail (IOError Nothing OtherError "exit should not return")
 
 exitWith (ExitFailure n) 
   | n == 0 = fail (IOError Nothing InvalidArgument "ExitFailure 0")
-  | otherwise = 
-    _ccall_ EXIT n             `thenIO_Prim` \ () ->
+  | otherwise = do
+    _ccall_ EXIT n
     fail (IOError Nothing OtherError "exit should not return")
 \end{code}
 
index de9fad9..30fe9ac 100644 (file)
@@ -29,10 +29,10 @@ import ST
 import IOBase
 import ArrBase
 import STBase
-import UnsafeST        ( unsafePerformPrimIO )
+import Unsafe  ( unsafePerformIO )
 import ST
 import Ix
-import Foreign  ( Addr(..) )
+import Addr
 import Char     ( intToDigit )
 import PackBase ( unpackCString )
 import Locale
@@ -72,7 +72,7 @@ we use the C library routines based on 32 bit integers.
 
 \begin{code}
 instance Show ClockTime where
-    showsPrec p (TOD sec@(J# a# s# d#) nsec) = showString $ unsafePerformPrimIO $
+    showsPrec p (TOD sec@(J# a# s# d#) nsec) = showString $ unsafePerformIO $
            allocChars 32               >>= \ buf ->
            _ccall_ showTime (I# s#) (ByteArray bottom d#) buf
                                        >>= \ str ->
@@ -147,35 +147,35 @@ data TimeDiff
 \begin{code}
 getClockTime :: IO ClockTime
 getClockTime =
-    malloc1                                        `thenIO_Prim` \ i1 ->
-    malloc1                                        `thenIO_Prim` \ i2 ->
-    _ccall_ getClockTime i1 i2                     `thenIO_Prim` \ rc ->
-    if rc == 0 then
-       cvtUnsigned i1                              `thenIO_Prim` \ sec ->
-       cvtUnsigned i2                              `thenIO_Prim` \ nsec ->
-       return (TOD sec (nsec * 1000))
-    else
-       constructErrorAndFail "getClockTime"
+    malloc1                                        >>= \ i1 ->
+    malloc1                                        >>= \ i2 ->
+    _ccall_ getClockTime i1 i2                     >>= \ rc ->
+    if rc == 0 
+       then
+           cvtUnsigned i1                          >>= \ sec ->
+           cvtUnsigned i2                          >>= \ nsec ->
+           return (TOD sec (nsec * 1000))
+       else
+           constructErrorAndFail "getClockTime"
   where
-    malloc1 = ST $ \ s# ->
+    malloc1 = IO $ \ s# ->
        case newIntArray# 1# s# of 
           StateAndMutableByteArray# s2# barr# -> 
-               STret s2# (MutableByteArray bottom barr#)
+               IOok s2# (MutableByteArray bottom barr#)
 
     --  The C routine fills in an unsigned word.  We don't have 
     -- `unsigned2Integer#,' so we freeze the data bits and use them 
     -- for an MP_INT structure.  Note that zero is still handled specially,
     -- although (J# 1# 1# (ptr to 0#)) is probably acceptable to gmp.
 
-    cvtUnsigned (MutableByteArray _ arr#) = ST $ \ s# ->
+    cvtUnsigned (MutableByteArray _ arr#) = IO $ \ s# ->
        case readIntArray# arr# 0# s# of 
          StateAndInt# s2# r# ->
-            if r# ==# 0# then
-                STret s2# 0
-            else
-                case unsafeFreezeByteArray# arr# s2# of
-                  StateAndByteArray# s3# frozen# -> 
-                       STret s3# (J# 1# 1# frozen#)
+            if r# ==# 0# 
+               then IOok s2# 0
+               else case unsafeFreezeByteArray# arr# s2# of
+                        StateAndByteArray# s3# frozen# -> 
+                               IOok s3# (J# 1# 1# frozen#)
 
 \end{code}
 
@@ -189,18 +189,18 @@ t2} as a @TimeDiff@.
 \begin{code}
 addToClockTime  :: TimeDiff  -> ClockTime -> ClockTime
 addToClockTime (TimeDiff year mon day hour min sec psec) 
-              (TOD c_sec c_psec) = unsafePerformPrimIO $
+              (TOD c_sec c_psec) = unsafePerformIO $
     allocWords (``sizeof(time_t)'') >>= \ res ->
     _ccall_ toClockSec year mon day hour min sec 0 res 
                                    >>= \ ptr@(A# ptr#) ->
-    if ptr /= ``NULL'' then
-       let
-       diff_sec  = (int2Integer# (indexIntOffAddr# ptr# 0#))
-       diff_psec = psec
-       in
-       return (TOD (c_sec + diff_sec) (c_psec + diff_psec))
-    else
-       error "Time.addToClockTime: can't perform conversion of TimeDiff"
+    if ptr /= ``NULL'' 
+       then let
+              diff_sec  = (int2Integer# (indexIntOffAddr# ptr# 0#))
+              diff_psec = psec
+                    in
+             return (TOD (c_sec + diff_sec) (c_psec + diff_psec))
+        else
+            error "Time.addToClockTime: can't perform conversion of TimeDiff"
 
 
 diffClockTimes  :: ClockTime -> ClockTime -> TimeDiff
@@ -227,52 +227,52 @@ ignored.
 
 \begin{code}
 toCalendarTime :: ClockTime -> CalendarTime
-toCalendarTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO $
+toCalendarTime (TOD sec@(J# a# s# d#) psec) = unsafePerformIO $
     allocWords (``sizeof(struct tm)''::Int)        >>= \ res ->
     allocChars 32                                  >>= \ zoneNm ->
     _casm_ ``SETZONE((struct tm *)%0,(char *)%1); '' res zoneNm          >>= \ () ->
     _ccall_ toLocalTime (I# s#) (ByteArray bottom d#) res
                                                    >>= \ tm ->
-    if tm == (``NULL''::Addr) then
-       error "Time.toCalendarTime: out of range"
-    else
-       _casm_ ``%r = ((struct tm *)%0)->tm_sec;'' tm   >>= \ sec ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_min;'' tm   >>= \ min ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_hour;'' tm  >>= \ hour ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_mday;'' tm  >>= \ mday ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_mon;'' tm   >>= \ mon ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_year;'' tm  >>= \ year ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_wday;'' tm  >>= \ wday ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_yday;'' tm  >>= \ yday ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_isdst;'' tm >>= \ isdst ->
-       _ccall_ ZONE tm                                 >>= \ zone ->
-       _ccall_ GMTOFF tm                               >>= \ tz ->
-       let
-        tzname = unpackCString zone
-       in
-        returnPrimIO (CalendarTime (1900+year) mon mday hour min sec psec 
-                      (toEnum wday) yday tzname tz (isdst /= 0))
+    if tm == (``NULL''::Addr) 
+       then error "Time.toCalendarTime: out of range"
+        else
+           _casm_ ``%r = ((struct tm *)%0)->tm_sec;'' tm       >>= \ sec ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_min;'' tm       >>= \ min ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_hour;'' tm      >>= \ hour ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_mday;'' tm      >>= \ mday ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_mon;'' tm       >>= \ mon ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_year;'' tm      >>= \ year ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_wday;'' tm      >>= \ wday ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_yday;'' tm      >>= \ yday ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_isdst;'' tm     >>= \ isdst ->
+           _ccall_ ZONE tm                                     >>= \ zone ->
+           _ccall_ GMTOFF tm                                   >>= \ tz ->
+           let
+            tzname = unpackCString zone
+           in
+            return (CalendarTime (1900+year) mon mday hour min sec psec 
+                         (toEnum wday) yday tzname tz (isdst /= 0))
 
 toUTCTime :: ClockTime -> CalendarTime
-toUTCTime  (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
+toUTCTime  (TOD sec@(J# a# s# d#) psec) = unsafePerformIO (
        allocWords (``sizeof(struct tm)''::Int)                     >>= \ res ->
         allocChars 32                                              >>= \ zoneNm ->
         _casm_ ``SETZONE((struct tm *)%0,(char *)%1); '' res zoneNm >>= \ () ->
         _ccall_ toUTCTime (I# s#) (ByteArray bottom d#) res
                                                    >>= \ tm ->
-    if tm == (``NULL''::Addr) then
-       error "Time.toUTCTime: out of range"
-    else
-       _casm_ ``%r = ((struct tm *)%0)->tm_sec;'' tm   >>= \ sec ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_min;'' tm   >>= \ min ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_hour;'' tm  >>= \ hour ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_mday;'' tm  >>= \ mday ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_mon;'' tm   >>= \ mon ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_year;'' tm  >>= \ year ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_wday;'' tm  >>= \ wday ->
-       _casm_ ``%r = ((struct tm *)%0)->tm_yday;'' tm  >>= \ yday ->
-        returnPrimIO (CalendarTime (1900+year) mon mday hour min sec psec 
-                      (toEnum wday) yday "UTC" 0 False)
+    if tm == (``NULL''::Addr) 
+       then error "Time.toUTCTime: out of range"
+        else
+           _casm_ ``%r = ((struct tm *)%0)->tm_sec;'' tm       >>= \ sec ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_min;'' tm       >>= \ min ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_hour;'' tm      >>= \ hour ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_mday;'' tm      >>= \ mday ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_mon;'' tm       >>= \ mon ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_year;'' tm      >>= \ year ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_wday;'' tm      >>= \ wday ->
+           _casm_ ``%r = ((struct tm *)%0)->tm_yday;'' tm      >>= \ yday ->
+            return (CalendarTime (1900+year) mon mday hour min sec psec 
+                         (toEnum wday) yday "UTC" 0 False)
     )
 
 toClockTime :: CalendarTime -> ClockTime
@@ -282,12 +282,12 @@ toClockTime (CalendarTime year mon mday hour min sec psec wday yday tzname tz is
     else if tz < -43200 || tz > 43200 then
         error "Time.toClockTime: timezone offset out of range"
     else
-        unsafePerformPrimIO (
+        unsafePerformIO (
            allocWords (``sizeof(time_t)'') >>= \ res ->
            _ccall_ toClockSec year mon mday hour min sec isDst res
                                                    >>= \ ptr@(A# ptr#) ->
             if ptr /= ``NULL'' then
-               returnPrimIO (TOD (int2Integer# (indexIntOffAddr# ptr# 0#)) psec)
+               return (TOD (int2Integer# (indexIntOffAddr# ptr# 0#)) psec)
            else
                error "Time.toClockTime: can't perform conversion"
         )
@@ -301,21 +301,21 @@ bottom = error "Time.bottom"
 -- (copied from PosixUtil, for now)
 -- Allocate a mutable array of characters with no indices.
 
-allocChars :: Int -> ST s (MutableByteArray s ())
-allocChars (I# size#) = ST $ \ s# ->
+allocChars :: Int -> IO (MutableByteArray RealWorld ())
+allocChars (I# size#) = IO $ \ s# ->
     case newCharArray# size# s# of 
       StateAndMutableByteArray# s2# barr# -> 
-       STret s2# (MutableByteArray bot barr#)
+       IOok s2# (MutableByteArray bot barr#)
   where
     bot = error "Time.allocChars"
 
 -- Allocate a mutable array of words with no indices
 
-allocWords :: Int -> ST s (MutableByteArray s ())
-allocWords (I# size#) = ST $ \ s# ->
+allocWords :: Int -> IO (MutableByteArray RealWorld ())
+allocWords (I# size#) = IO $ \ s# ->
     case newIntArray# size# s# of 
       StateAndMutableByteArray# s2# barr# -> 
-       STret s2# (MutableByteArray bot barr#)
+       IOok s2# (MutableByteArray bot barr#)
   where
     bot = error "Time.allocWords"
 
index 14d6e05..1ffa934 100644 (file)
@@ -2,7 +2,7 @@
 \begin{code}
 #include "rtsdefs.h"
 
-EXTDATA(GHCmain_mainPrimIO_closure);
+EXTDATA(GHCmain_mainIO_closure);
 
-P_ TopClosure = GHCmain_mainPrimIO_closure;
+P_ TopClosure = GHCmain_mainIO_closure;
 \end{code}