Skip to content
Snippets Groups Projects
Commit 4465c6cb authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

[project @ 1998-12-21 10:45:36 by simonpj]

Add utils/Panic.lhs
parent f922d4f5
No related merge requests found
%
% (c) The GRASP Project, Glasgow University, 1992-1998
%
\section{Panic error messages}
Defines basic funtions for printing error messages.
It's hard to put these functions anywhere else without causing
some unnecessary loops in the module dependency graph.
\begin{code}
module Panic ( panic, panic#, assertPanic, trace ) where
import GlaExts( trace )
#include "HsVersions.h"
\end{code}
\begin{code}
panic :: String -> a
panic x = error ("panic! (the `impossible' happened):\n\t"
++ x ++ "\n\n"
++ "Please report it as a compiler bug "
++ "to glasgow-haskell-bugs@dcs.gla.ac.uk.\n\n" )
-- #-versions because panic can't return an unboxed int, and that's
-- what TAG_ is with GHC at the moment. Ugh. (Simon)
-- No, man -- Too Beautiful! (Will)
panic# :: String -> FAST_INT
panic# s = case (panic s) of () -> ILIT(0)
assertPanic :: String -> Int -> a
assertPanic file line = panic ("ASSERT failed! file " ++ file ++ ", line " ++ show line)
\end{code}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment