+% -----------------------------------------------------------------------------
+% $Id: PrelErr.lhs,v 1.21 2001/07/24 16:09:48 simonpj Exp $
%
-% (c) The AQUA Project, Glasgow University, 1994-1996
+% (c) The University of Glasgow, 1994-2000
%
\section[PrelErr]{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
+ , undefined -- :: a
) where
import PrelBase
-- error stops execution and displays an error message
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.
+
+undefined :: a
+undefined = error "Prelude.undefined"
\end{code}
%*********************************************************
noMethodBindingError s = throw (NoMethodError (untangle s "No instance nor default method for class operation"))
irrefutPatError s = throw (PatternMatchFail (untangle s "Irrefutable pattern failed for pattern"))
-nonExhaustiveGuardsError s = throw (NonExhaustiveGuards (untangle s "Non-exhaustive guards in"))
+nonExhaustiveGuardsError s = throw (PatternMatchFail (untangle s "Non-exhaustive guards in"))
patError s = throw (PatternMatchFail (untangle s "Non-exhaustive patterns in"))
recSelError s = throw (RecSelError (untangle s "Missing field in record selection"))
recConError s = throw (RecConError (untangle s "Missing field in record construction"))