From: simonpj Date: Tue, 24 Jul 2001 16:04:21 +0000 (+0000) Subject: [project @ 2001-07-24 16:04:21 by simonpj] X-Git-Tag: Approximately_9120_patches~1426 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ecce126956fdd4868c1da0122bd92745c381dfa9;p=ghc-hetmet.git [project @ 2001-07-24 16:04:21 by simonpj] Add errorCString --- diff --git a/ghc/lib/std/PrelErr.lhs b/ghc/lib/std/PrelErr.lhs index cd6a56f..0523aae 100644 --- a/ghc/lib/std/PrelErr.lhs +++ b/ghc/lib/std/PrelErr.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelErr.lhs,v 1.19 2001/05/18 16:54:05 simonmar Exp $ +% $Id: PrelErr.lhs,v 1.20 2001/07/24 16:04:21 simonpj Exp $ % % (c) The University of Glasgow, 1994-2000 % @@ -28,6 +28,7 @@ module PrelErr , absentErr, parError -- :: a , seqError -- :: a + , errorCString -- :: Addr# -> a -- Arg is a ptr to C string , error -- :: String -> a , assertError -- :: String -> Bool -> a -> a @@ -50,6 +51,9 @@ import PrelException error :: String -> a error s = throw (ErrorCall s) +errorCString :: Addr# -> a +errorCString s = error (unpackCString s) + -- It is expected that compilers will recognize this and insert error -- messages which are more appropriate to the context in which undefined -- appears.