2 % (c) The AQUA Project, Glasgow University, 1994-1996
5 \section[GHCerr]{Module @GHCerr@}
7 The GHCerr module defines the code for the wired-in error functions,
8 which have a special type in the compiler (with "open tyvars").
10 We cannot define these functions in a module where they might be used
11 (e.g., GHCbase), because the magical wired-in type will get confused
12 with what the typechecker figures out.
19 ---------------------------------------------------------------
20 -- HACK: Magic unfoldings not implemented for unboxed lists
21 -- Need to define a "build" to avoid undefined symbol
22 -- in this module to avoid .hi proliferation.
24 build = error "GHCbase.build"
25 augment = error "GHCbase.augment"
26 --{-# GENERATE_SPECS build a #-}
27 --build :: ((a -> [a] -> [a]) -> [a] -> [a]) -> [a]
31 ---------------------------------------------------------------
32 -- Used for compiler-generated error message;
33 -- encoding saves bytes of string junk.
35 absentErr, parError :: a
37 , noDefaultMethodError
38 , noExplicitMethodError
39 , nonExhaustiveGuardsError
42 , recUpdError :: String -> a
44 absentErr = error "Oops! The program has entered an `absent' argument!\n"
45 parError = error "Oops! Entered GHCerr.parError (a GHC bug -- please report it!)\n"
47 noDefaultMethodError s = error ("noDefaultMethodError:"++s)
48 noExplicitMethodError s = error ("No default method for class operation "++s)
50 irrefutPatError s = patError__ (untangle s "irrefutable pattern")
51 nonExhaustiveGuardsError s = patError__ (untangle s "non-exhaustive guards")
52 patError s = patError__ (untangle s "pattern-matching")
54 patError__ = error__ (\ x -> _ccall_ PatErrorHdrHook x)
56 recConError s = error (untangle s "record constructor")
57 recUpdError s = error (untangle s "record update")
61 ++ (if null msg then "" else (": " ++ msg))
67 = case (span not_bar coded) of { (f, (_:rest)) ->
68 case (span not_bar rest) of { (l, (_:m)) ->