[project @ 1997-11-12 10:55:17 by simonm]
authorsimonm <unknown>
Wed, 12 Nov 1997 10:55:26 +0000 (10:55 +0000)
committersimonm <unknown>
Wed, 12 Nov 1997 10:55:26 +0000 (10:55 +0000)
PrimIO/library changes

ghc/tests/codeGen/should_run/cg015.hs
ghc/tests/codeGen/should_run/cg025.hs
ghc/tests/codeGen/should_run/cg025.stderr
ghc/tests/codeGen/should_run/cg026.hs
ghc/tests/codeGen/should_run/cg029.hs
ghc/tests/codeGen/should_run/cg035.hs
ghc/tests/codeGen/should_run/cg042.hs
ghc/tests/codeGen/should_run/cg043.hs

index 9c0f07b..dab67e5 100644 (file)
@@ -1,6 +1,5 @@
-module GHCmain ( mainPrimIO ) where
+module GHCmain ( mainIO ) where
 
-import GlaExts
 import PrelBase
 
 data CList = CNil | CCons Int# CList
@@ -14,7 +13,7 @@ clen :: CList -> Int#
 clen CNil = 0#
 clen (CCons _ cl) = 1# +# (clen cl)
 
-mainPrimIO = case (clen list4) of
+mainIO = case (clen list4) of
                len4 ->
                  case (len4 +# len4) of
                    8# -> finish 65#    -- 'A'
@@ -22,5 +21,5 @@ mainPrimIO = case (clen list4) of
       where
       list4    = mk 4#
 
-finish :: Int# -> PrimIO ()
-finish n = _ccall_ putchar (C# (chr# n)) `seqPrimIO` returnPrimIO ()
+finish :: Int# -> IO ()
+finish n = _ccall_ putchar (C# (chr# n)) >> return ()
index 6b2a820..9700086 100644 (file)
@@ -3,8 +3,7 @@
 --
 import IO
 import System
-import IOBase (trace)
---import Trace ToDo: get this via GlaExts -- SOF
+import IOExts (trace)
 
 main = do
     prog <- getProgName
index 8caaaca..6be7131 100644 (file)
@@ -6,8 +6,7 @@
 --
 import IO
 import System
-import IOBase (trace)
---import Trace ToDo: get this via GlaExts -- SOF
+import IOExts (trace)
 
 main = do
     prog <- getProgName
index 8b11d63..d6b4eaf 100644 (file)
@@ -2,12 +2,15 @@
 --
 module Main ( main ) where
 
-import PrelBase --ghc1.3
-import GlaExts
+import PrelBase
 import ST
+import IOExts
+import MutableArray
+import ByteArray
+import Addr
 
-import Ratio   -- 1.3
-import Array   -- 1.3
+import Ratio
+import Array
 
 main = putStr
         (test_chars    ++ "\n"  ++
@@ -25,9 +28,9 @@ test_chars :: String
 test_chars
   = let str = reverse "Now is the time for all good men to come to...\n"
     in
-    unsafePerformPrimIO (
+    unsafePerformIO (
        _ccall_ fprintf (``stdout''::Addr) "%d %s\n" 93 str >>
-       returnPrimIO ""
+       return ""
        )
 
 -- Arr# Int# -------------------------------------------
@@ -56,7 +59,7 @@ test_ints
 
     fill_in arr_in# first# last#
       = if (first# ># last#)
-       then returnST ()
+       then return ()
        else writeIntArray arr_in# (I# first#) (I# (first# *# first#)) >>
             fill_in arr_in# (first# +# 1#) last#
 
@@ -93,7 +96,7 @@ test_addrs
 
     fill_in arr_in# first# last#
       = if (first# ># last#)
-       then returnST ()
+       then return ()
        else writeAddrArray arr_in# (I# first#)
                            (A# (int2Addr# (first# *# first#))) >>
             fill_in arr_in# (first# +# 1#) last#
@@ -134,7 +137,7 @@ test_floats
 
     fill_in arr_in# first# last#
       = if (first# ># last#)
-       then returnST ()
+       then return ()
 {-     else let e = ((fromInt (I# first#)) * pi)
             in trace (show e) $ writeFloatArray arr_in# (I# first#) e >>
             fill_in arr_in# (first# +# 1#) last#
@@ -175,7 +178,7 @@ test_doubles
 
     fill_in arr_in# first# last#
       = if (first# ># last#)
-       then returnST ()
+       then return ()
        else writeDoubleArray arr_in# (I# first#) ((fromInt (I# first#)) * pi) >>
             fill_in arr_in# (first# +# 1#) last#
 
@@ -209,7 +212,7 @@ test_ptrs
 
     fill_in arr_in# first last
       = if (first > last)
-       then returnST ()
+       then return ()
        else writeArray arr_in# first (fromInt (first * first)) >>
             fill_in  arr_in# (first + 1) last
 
index 7c14131..9748af4 100644 (file)
@@ -3,7 +3,6 @@ module Main(main) where
 -- In 0.19, we lost the ability to do ccalls with more than 6 arguments
 -- on the Sparc.  Just to make sure it never happens again...
 
-import GlaExts
 
 main = 
        _ccall_ printf "Testing %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n"
@@ -11,5 +10,5 @@ main =
        (11::Int) (12::Int) (13::Int) (14::Int) (15::Int) (16::Int) (17::Int) (18::Int)
        (21::Int) (22::Int) (23::Int) (24::Int) (25::Int) (26::Int) (27::Int) (28::Int)
        (31::Int) (32::Int) (33::Int) (34::Int) (35::Int) (36::Int) (37::Int) (38::Int)
-       `thenIO_Prim`  \ _ ->
+       >>
        return ()
index 6e6cbab..9ac75fc 100644 (file)
@@ -1,12 +1,11 @@
 module Main (main) where
 
---import PreludeGlaST
-import GlaExts
+import IOExts ( unsafePerformIO )
 
 po :: Double -> Double
 po rd = 0.5 + 0.5 * erf ((rd / 1.04) / sqrt 2)
   where
     erf :: Double -> Double
-    erf x = unsafePerformPrimIO (_ccall_ erf x)
+    erf x = unsafePerformIO (_ccall_ erf x)
 
 main = putStr (shows (po 2.0) "\n")
index cbb4489..b20c462 100644 (file)
@@ -3,7 +3,9 @@
 module Main ( main ) where
 
 import PrelBase --ghc1.3
-import GlaExts
+import IOExts
+import ByteArray
+import MutableArray
 import ST
 
 import Ratio   -- 1.3
@@ -37,7 +39,7 @@ test_doubles
 
     fill_in arr_in# first# last#
       = if (first# ># last#)
-       then returnST ()
+       then return ()
        else writeDoubleArray arr_in# (I# first#) ((fromInt (I# first#)) * pi) >>
             fill_in arr_in# (first# +# 1#) last#
 
index 7e06095..1965c44 100644 (file)
@@ -3,10 +3,8 @@
 --!!! when converting CoreSyn.App)
 
 module Main where
-import GlaExts
 
-
-getData :: String -> PrimIO ()
+getData :: String -> IO ()
 getData filename = case leng filename of {0 -> return ()}
 leng :: String -> Int
 leng [] = 0 --case ls of {[] -> 0 ; (_:xs) -> 1 + leng xs }
@@ -16,6 +14,5 @@ f [] [] = []
 f xs ys = f xs ys
 
 main =
-    primIOToIO (
-     (return ())  >>= \ _ ->
-     case f [] [] of { [] -> getData [] })
+     return ()  >>= \ _ ->
+     case f [] [] of { [] -> getData [] }