[mutable data update
John Meacham <john@repetae.net>**20060217003814] hunk ./lib/Data/IORef.hs 10
-import Prelude.IO
+import Jhc.IO
hunk ./lib/Data/IORef.hs 12
-data IORef a
+data Ref s a
hunk ./lib/Data/IORef.hs 14
-foreign import primitive newIORef :: a -> IO (IORef a)
-foreign import primitive readIORef :: IORef a -> IO a
-foreign import primitive writeIORef :: IORef a -> a -> IO ()
+type IORef = Ref World__
hunk ./lib/Data/IORef.hs 16
-foreign import primitive eqIORef :: IORef a -> IORef a -> Bool
+foreign import primitive newRef__ :: forall s . a -> s -> (s,Ref s a)
+foreign import primitive readRef__ :: forall s . Ref s a -> s -> (s,a)
+foreign import primitive writeRef__ :: forall s . Ref s a -> a -> s
+
+foreign import primitive eqRef__ :: forall s . Ref s a -> Ref s a -> Bool
+
+newIORef v = IO $ \world -> case newRef__ v world of
+    (world',r) -> JustIO world' r
+readIORef r = IO $ \world -> case readRef__ r world of
+    (world',v) -> JustIO world' v
+writeIORef r v = IO $ \world -> case writeRef__ r v of
+    world' -> JustIO world' ()
hunk ./lib/Data/IORef.hs 30
-    x == y = eqIORef x y
-    x /= y = not (eqIORef x y)
+    x == y = eqRef__ x y
+    x /= y = not (eqRef__ x y)
hunk ./lib/Jhc/Array.hs 9
-newtype AT a = AT (Array__ -> Array__)
+newtype AT a = AT (Array__ a -> Array__ a)
hunk ./lib/Jhc/Array.hs 18
-newAT__ n (AT a1) = a1 (prim_newAT__ (newUnique__ a1) n)
+newAT__ n (AT a1) = a1 (prim_newAT__ (newWorld__ a1) n)
hunk ./lib/Jhc/Array.hs 24
-foreign import primitive "prim_newAT__" :: World__ -> Int -> Array__
-foreign import primitive "prim_writeAT__" :: Int -> a -> Array__ -> Array__
+foreign import primitive prim_newAT__ :: World__ -> Int -> Array__ a
+foreign import primitive prim_writeAT__ :: Int -> a -> Array__ a -> Array__ a
hunk ./lib/Jhc/Array.hs 28
-foreign import primitive "unsafeAt__" :: Array__ a -> Int -> a
+foreign import primitive unsafeAt__ :: Array__ a -> Int -> a
hunk ./lib/Jhc/Array.hs 32
-newArray xs = newAT__ (length as) $ foldr assign doneAT (zip [0..] xs) where
+newArray xs = newAT__ (length xs) $ foldr assign doneAT__ (zip [0..] xs) where