The Haskell Error Index

Welcome

This site describes the various messages that can be returned by GHC, the most-commonly-used Haskell implementation, including both errors and warnings. Beginning with version 9.6.1, GHC emits a code with the format [GHC-12345] for each message. These codes can be looked up below for further information.

Other Haskell-related tools are welcome to add their own messages to the index. Please contact the Haskell Foundation or open an issue to begin the process.

So far, 66 errors and warnings are documented here. If you encounter a message that is not yet documented, please open an issue or submit a pull request with documentation. Pull requests with additional examples and improved explanations for existing messages are also very welcome, as are improvements to the generated site.

This site is a project of The Haskell Foundation. Please get in touch if you have feedback or if you'd like to get involved!

The Messages

Nr.MessageSummarySince
GHC-00158 Cannot derive instance for non-stock-deriveable class An instance cannot be derived because the class is not stock deriveable. 9.6.1
GHC-00482 Lambda syntax in pattern Lambda syntax appears in a pattern match. 9.6.1
GHC-01629 Too many type arguments in constructor pattern Too many type applications to a constructor in a pattern. 9.6.1
GHC-03272 Bidirectional formatting warning The source file contains Unicode bidirectional formatting instructions 9.6.1
GHC-04924 Unknown flag in GHC options pragma Unknown flag in {-\# OPTIONS_GHC \#-} pragma. 9.6.1
GHC-04956 Can't derive instances of nullary classes It is not possible to derive instances of argumentless type classes without the DeriveAnyClass extension. 9.6.1
GHC-05989 Too many type binders A type constructor is declared with more arguments than its kind annotation specifies. 9.6.1
GHC-06446 Do notation in pattern match Do notation in pattern match. 9.6.1
GHC-09009 Illegal role name. Type roles should be one of representational, nominal, or phantom. 9.6.1
GHC-10190 Empty enumeration An enumeration would be empty. 9.6.1
GHC-10333 Generalized newtype deriving doesn't work on non-newtypes Generalized newtype deriving works only for types declared with the newtype keyword. 9.6.1
GHC-11861 Empty single quotes No character literal provided within single quotes. 9.6.1
GHC-11913 Illegal deriving item Something other than a type class appears in a deriving statement. 9.6.1
GHC-12003 Type equality not in scope The type equality operator has not been imported into the current module. 9.6.1
GHC-20125 Missing field(s) Initialization of record with missing field(s). 9.6.1
GHC-20825 Empty record update Record update syntax requires that at least one field be specified. 9.6.1
GHC-24180 Too few arguments to infix type operator A type operator was not provided with both arguments. 9.6.1
GHC-25078 Precedence out of range An invalid operator precedence was provided. 9.6.1
GHC-27207 Missing space after tilde `~` Lazy pattern in expression context. 9.6.1
GHC-28007 Misplaced LANGUAGE pragma LANGUAGE pragmas should come before the module declaration. 9.6.1
GHC-30606 Redundant constraints A binding has constraints that are redundant. 9.6.1
GHC-39999 No instance arising An expression requires a type class instance which is not provided by the context. 9.6.1
GHC-40798 Operator whitespace An optional warning for detecting usage of infix, suffix or prefix operators that could be parsed differently in future due to whitespace. 9.6.1
GHC-45696 If-Then-Else in pattern match If-Then-Else expression in pattern match. 9.6.1
GHC-46956 Kind variable would escape its scope A local kind variable was used to classify a type from a scope in which the kind variable is not available. 9.6.1
GHC-47535 Identifier is not a record selector An identifier does not refer to a record selector but is used as such. 9.6.1
GHC-47854 Duplicate Exports An identifier appears twice in an export list. 9.6.1
GHC-48099 Top-level strict or unlifted binds not allowed Top-level bindings may not be strict, and they may not have unlifted types. 9.6.1
GHC-48361 Binding type variables is not allowed in pattern bindings You can only bind value-level variables in a pattern, not type variables. 9.6.1
GHC-49957 Unticked promoted constructors A promoted data constructor was used as a type without it being indicated with a tick mark. 9.6.1
GHC-51179 Missing LambdaCase Missing LambdaCase language extension 9.6.1
GHC-53633 Redundant patterns A pattern is impossible to reach due to earlier patterns 9.6.1
GHC-53786 Case expression included in pattern A pattern contains case-of syntax. 9.6.1
GHC-56538 Instance head is not headed by a class A type class instance declaration is declared for something that is not a type class. 9.6.1
GHC-58481 Parse error on input Generic parsing error. 9.6.1
GHC-62016 Cannot derive well-kinded instance An instance cannot be derived because the kinds cannot be made to match. 9.6.1
GHC-62161 Incomplete patterns Pattern match(es) are non-exhaustive. 9.6.1
GHC-62330 Underscores not allowed in float and integer literals Float and integer literals cannot contain underscores. 9.6.1
GHC-64725 User-defined type error An invalid constraint or type family reduces to a custom type error. 9.6.1
GHC-66228 View pattern in expression context A view pattern was used in an expression, rather than a pattern. 9.6.1
GHC-68686 Cannot parse LANGUAGE pragma The arguments to the LANGUAGE pragma could not be parsed 9.6.1
GHC-69158 Conflicting exports Different identifiers with the same name are (re-)exported from the same module. 9.6.1
GHC-69925 Illegal unboxed string literal in pattern Illegal unboxed string literal in pattern. 9.6.1
GHC-70712 Double dots in record update Double-dot syntax is not allowed in a record update. 9.6.1
GHC-71614 Lambda requires at least one parameter A lambda expression must have at least one parameter. 9.6.1
GHC-75356 Export item suggests constructors/methods An export item suggests that (in-scope) constructors or class methods exist when they do not. 9.6.1
GHC-76037 Not in scope An identifier is not in scope. 9.6.1
GHC-77037 No explicit import list Items brought into scope are not listed explicitly. 9.6.1
GHC-77539 Illegal tuple constraint A tuple of constraints was used without enabling the ConstraintKinds extension 9.6.1
GHC-80768 Class kind signatures need to be constraints It is an error to use type families in the return kind of a class 9.6.1
GHC-84077 Type application without space A type application with @ does not have a space before. 9.6.1
GHC-87429 Illegal datatype context Constraints present in datatype declaration without DatatypeContexts. 9.6.1
GHC-88464 Variable not in scope An unknown variable name was referenced. 9.6.1
GHC-90177 Orphan instance An instance was defined separately from its type or class. 9.6.1
GHC-90584 Deriving `Typeable` has no effect The type class `Typeable` does not need to be derived. 9.6.1
GHC-91938 Equations have different number of arguments Each equation in a function definition must have the same number of arguments. 9.6.1
GHC-92994 Unexpected nested forall in foreign declaration A foreign function import uses a higher-rank type. 9.6.1
GHC-94817 Tab character A tab character occurred in the input file. 9.6.1
GHC-95644 Missing space after exclamation mark `!` Bang pattern in expression context. 9.6.1
GHC-95781 Invalid type application The expression cannot be applied to the given type argument. 9.6.1
GHC-95909 Missing strict fields Constructor was not instantiated with required strict field(s). 9.6.1
GHC-97739 Kind and type arguments out of dependency order Kind arguments must occur prior to the types that they classify. 9.6.1
GHC-98980 Command syntax in pattern Arrow command syntax was used in a pattern. 9.6.1
GHC-99623 Import item suggests constructors/methods An import item suggests that (in-scope) constructors or class methods exist when they do not. 9.6.1
S-4804 Stack failed to construct a build plan The package with the given name or version could not be found in the snapshot 2.9.3
S-6602 Could not parse YAML configuration file A YAML configuration file was either not well-formed YAML or didn't contain the expected data 2.9.3