From: simonmar Date: Tue, 27 Feb 2001 13:38:58 +0000 (+0000) Subject: [project @ 2001-02-27 13:38:58 by simonmar] X-Git-Tag: Approximately_9120_patches~2532 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=42d07019978e59f44e4e07ae5f78d32e60727476;p=ghc-hetmet.git [project @ 2001-02-27 13:38:58 by simonmar] changes for commandline do-bindings: define failIO. --- diff --git a/ghc/lib/std/PrelIOBase.lhs b/ghc/lib/std/PrelIOBase.lhs index fef341e..8e1971f 100644 --- a/ghc/lib/std/PrelIOBase.lhs +++ b/ghc/lib/std/PrelIOBase.lhs @@ -1,5 +1,5 @@ % ------------------------------------------------------------------------------ -% $Id: PrelIOBase.lhs,v 1.36 2001/02/27 13:38:15 simonmar Exp $ +% $Id: PrelIOBase.lhs,v 1.37 2001/02/27 13:38:58 simonmar Exp $ % % (c) The University of Glasgow, 1994-2000 % @@ -93,7 +93,10 @@ instance Monad IO where return x = returnIO x m >>= k = bindIO m k - fail s = ioError (userError s) + fail s = failIO s + +failIO :: String -> IO a +failIO s = ioError (userError s) liftIO :: IO a -> State# RealWorld -> STret RealWorld a liftIO (IO m) = \s -> case m s of (# s', r #) -> STret s' r