HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulelanguage-c-0.9.3Haskell2010

Language.C.Data.Error

Base type for errors occurring in parsing, analysing and pretty-printing. With ideas from Simon Marlow's "An extensible dynamically-typed hierarchy of execeptions [2006]"

  • 5 types
  • 1 class
  • 11 values
  • Packagelanguage-c-0.9.3
  • Exports17
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceError.hs

Severity Level

2 declarations
valueisHardError :: Error ex => ex -> Bool
#

return True when the given error makes it impossible to continue analysis or compilation.

Error class

4 declarations
classclass (Typeable e, Show e) => Error e where
#

errors in Language.C are instance of Error

Methods

Instances8Error, …

Error supertype

1 declaration
datadata CError
#

supertype of all errors

Constructors

Instances2Show, Error
  • Show CErrorDefined in language-c-0.9.3 · Language.C.Data.Error
  • Error CErrorDefined in language-c-0.9.3 · Language.C.Data.Error

Infos attached to errors

4 declarations

converts an error into a string using a fixed format

  • either the lines of the long error message or the short message has to be non-empty

  • the format is

   <fname>:<row>: (column <col>) [<err lvl>]
     >>> <line_1>
     <line_2>
       ...
     <line_n>

Default error types

5 declarations
newtypenewtype UserError
#

unspecified error raised by the user (in case the user does not want to define her own error types).

Instances2Show, Error

Raising internal errors

1 declaration
valueinternalErr :: String -> a
#

raise a fatal internal error; message may have multiple lines