1 {- The GHCerr module defines the code for the
2 wired-in error functions, which have a special
3 type in the compiler (with "open tyvars").
5 We cannot define these functions in a module where they might be
6 used (e.g., GHCbase), because the magical wired-in type will get
7 confused with what the typechecker figures out.
11 import GHCbase (error__)
13 ---------------------------------------------------------------
14 -- HACK: Magic unfoldings not implemented for unboxed lists
15 -- Need to define a "build" to avoid undefined symbol
16 -- in this module to avoid .hi proliferation.
18 build = error "GHCbase.build"
19 augment = error "GHCbase.augment"
20 --{-# GENERATE_SPECS build a #-}
21 --build :: ((a -> [a] -> [a]) -> [a] -> [a]) -> [a]
25 ---------------------------------------------------------------
26 cannon_fodder_to_avoid_empty__versions__ = (1::Int)
28 -- Used for compiler-generated error message;
29 -- encoding saves bytes of string junk.
31 absentErr, parError :: a
33 , noDefaultMethodError
34 , noExplicitMethodError
35 , nonExhaustiveGuardsError
38 , recUpdError :: String -> a
40 absentErr = error "Oops! The program has entered an `absent' argument!\n"
41 parError = error "Oops! Entered GHCbase.parError (a GHC bug -- please report it!)\n"
43 noDefaultMethodError s = error ("noDefaultMethodError:"++s)
44 noExplicitMethodError s = error ("noExplicitMethodError:"++s)
46 irrefutPatError s = patError__ (untangle s "irrefutable pattern")
47 nonExhaustiveGuardsError s = patError__ (untangle s "non-exhaustive guards")
48 patError s = patError__ (untangle s "pattern-matching")
50 patError__ = error__ (\ x -> _ccall_ PatErrorHdrHook x)
52 recConError s = error (untangle s "record constructor")
53 recUpdError s = error (untangle s "record update")
57 ++ (if null msg then "" else (": " ++ msg))
63 = case (span not_bar coded) of { (f, (_:rest)) ->
64 case (span not_bar rest) of { (l, (_:m)) ->