HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulelanguage-c-0.10.2Haskell2010

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.10.2
  • 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.10.2 · Language.C.Data.Error
  • Error CErrorDefined in language-c-0.10.2 · 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
  • Show UserErrorDefined in language-c-0.10.2 · Language.C.Data.Error
  • Error UserErrorDefined in language-c-0.10.2 · Language.C.Data.Error

Raising internal errors

1 declaration
valueinternalErr :: String -> a
#

raise a fatal internal error; message may have multiple lines