[project @ 2002-04-11 12:03:43 by simonpj]
[haskell-directory.git] / GHC / IOBase.lhs
index 6ef6b06..e1b8ec3 100644 (file)
@@ -1,5 +1,5 @@
 % ------------------------------------------------------------------------------
-% $Id: IOBase.lhs,v 1.7 2002/03/14 12:09:50 simonmar Exp $
+% $Id: IOBase.lhs,v 1.8 2002/04/11 12:03:44 simonpj Exp $
 % 
 % (c) The University of Glasgow, 1994-2001
 %
@@ -78,6 +78,12 @@ bindIO (IO m) k = IO ( \ s ->
     (# new_s, a #) -> unIO (k a) new_s
   )
 
+thenIO :: IO a -> IO b -> IO b
+thenIO (IO m) k = IO ( \ s ->
+  case m s of 
+    (# new_s, a #) -> unIO k new_s
+  )
+
 returnIO :: a -> IO a
 returnIO x = IO (\ s -> (# s, x #))