From 4dd6885944754f2e69660d988e3479c1eb5d8ab9 Mon Sep 17 00:00:00 2001
From: simonm <unknown>
Date: Wed, 12 Nov 1997 10:55:26 +0000
Subject: [PATCH] [project @ 1997-11-12 10:55:17 by simonm] PrimIO/library
 changes

---
 ghc/tests/codeGen/should_run/cg015.hs     |  9 ++++----
 ghc/tests/codeGen/should_run/cg025.hs     |  3 +--
 ghc/tests/codeGen/should_run/cg025.stderr |  3 +--
 ghc/tests/codeGen/should_run/cg026.hs     | 25 +++++++++++++----------
 ghc/tests/codeGen/should_run/cg029.hs     |  3 +--
 ghc/tests/codeGen/should_run/cg035.hs     |  5 ++---
 ghc/tests/codeGen/should_run/cg042.hs     |  6 ++++--
 ghc/tests/codeGen/should_run/cg043.hs     |  9 +++-----
 8 files changed, 30 insertions(+), 33 deletions(-)

diff --git a/ghc/tests/codeGen/should_run/cg015.hs b/ghc/tests/codeGen/should_run/cg015.hs
index 9c0f07b0ab1b..dab67e59b20a 100644
--- a/ghc/tests/codeGen/should_run/cg015.hs
+++ b/ghc/tests/codeGen/should_run/cg015.hs
@@ -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 ()
diff --git a/ghc/tests/codeGen/should_run/cg025.hs b/ghc/tests/codeGen/should_run/cg025.hs
index 6b2a8207e0a4..9700086ec2a8 100644
--- a/ghc/tests/codeGen/should_run/cg025.hs
+++ b/ghc/tests/codeGen/should_run/cg025.hs
@@ -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
diff --git a/ghc/tests/codeGen/should_run/cg025.stderr b/ghc/tests/codeGen/should_run/cg025.stderr
index 8caaaca00a7c..6be7131e16dd 100644
--- a/ghc/tests/codeGen/should_run/cg025.stderr
+++ b/ghc/tests/codeGen/should_run/cg025.stderr
@@ -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
diff --git a/ghc/tests/codeGen/should_run/cg026.hs b/ghc/tests/codeGen/should_run/cg026.hs
index 8b11d6325f93..d6b4eafedeef 100644
--- a/ghc/tests/codeGen/should_run/cg026.hs
+++ b/ghc/tests/codeGen/should_run/cg026.hs
@@ -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
 
diff --git a/ghc/tests/codeGen/should_run/cg029.hs b/ghc/tests/codeGen/should_run/cg029.hs
index 7c14131e43ff..9748af459b87 100644
--- a/ghc/tests/codeGen/should_run/cg029.hs
+++ b/ghc/tests/codeGen/should_run/cg029.hs
@@ -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 ()
diff --git a/ghc/tests/codeGen/should_run/cg035.hs b/ghc/tests/codeGen/should_run/cg035.hs
index 6e6cbabb992d..9ac75fc5af89 100644
--- a/ghc/tests/codeGen/should_run/cg035.hs
+++ b/ghc/tests/codeGen/should_run/cg035.hs
@@ -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")
diff --git a/ghc/tests/codeGen/should_run/cg042.hs b/ghc/tests/codeGen/should_run/cg042.hs
index cbb44890c156..b20c4624b3cb 100644
--- a/ghc/tests/codeGen/should_run/cg042.hs
+++ b/ghc/tests/codeGen/should_run/cg042.hs
@@ -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#
 
diff --git a/ghc/tests/codeGen/should_run/cg043.hs b/ghc/tests/codeGen/should_run/cg043.hs
index 7e06095c5e35..1965c4458140 100644
--- a/ghc/tests/codeGen/should_run/cg043.hs
+++ b/ghc/tests/codeGen/should_run/cg043.hs
@@ -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 [] }
-- 
GitLab