X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIOBase.lhs;h=e1b8ec3d743b7dd4d3a62df15d93c7c776b5aea3;hb=9fa9bc17072a58c0bae2cce4764d38677e96ac29;hp=6ef6b061fc8fd2130cefcecc19bece968ab23523;hpb=bb49ec07b01f68599a49ce04473bd9616c739687;p=haskell-directory.git diff --git a/GHC/IOBase.lhs b/GHC/IOBase.lhs index 6ef6b06..e1b8ec3 100644 --- a/GHC/IOBase.lhs +++ b/GHC/IOBase.lhs @@ -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 #))