diff --git a/message-index/messages/GHC-67120/example1/after/Main.hs b/message-index/messages/GHC-67120/example1/after/Main.hs new file mode 100644 index 00000000..49e521c7 --- /dev/null +++ b/message-index/messages/GHC-67120/example1/after/Main.hs @@ -0,0 +1,6 @@ +module Main where + +-- Insert the fixed example here. + +main :: IO () +main = putStrLn "Hello, World!" diff --git a/message-index/messages/GHC-67120/example1/before/Main.hs b/message-index/messages/GHC-67120/example1/before/Main.hs new file mode 100644 index 00000000..aa8ff672 --- /dev/null +++ b/message-index/messages/GHC-67120/example1/before/Main.hs @@ -0,0 +1,6 @@ +module Main where + +-- Insert the example containing a bug here. + +notMain :: IO () +notMain = putStrLn "Hello, World!" diff --git a/message-index/messages/GHC-67120/example1/index.md b/message-index/messages/GHC-67120/example1/index.md new file mode 100644 index 00000000..012d61b9 --- /dev/null +++ b/message-index/messages/GHC-67120/example1/index.md @@ -0,0 +1,3 @@ +--- +title: +--- diff --git a/message-index/messages/GHC-67120/index.md b/message-index/messages/GHC-67120/index.md new file mode 100644 index 00000000..8780ef19 --- /dev/null +++ b/message-index/messages/GHC-67120/index.md @@ -0,0 +1,18 @@ +--- +title: Missing main +summary: Missing main action +severity: error +introduced: 9.8.1 +--- + +According to the second paragraph of Chapter 5 of The Haskell 98 Report, +> A Haskell program is a collection of modules, one of which, by convention, must be called Main and must export the value main. The value of the program is the value of the identifier main in module Main, which must be a computation of type IO t for some type t (see Chapter 7). When the program is executed, the computation main is performed, and its result (of type t) is discarded. + +## Example error text +``` +error: [GHC-67120] + The IO action ‘main’ is not defined in module ‘Main’ + | +1 | module Main where + | ^ +``` diff --git a/message-index/messages/GHC-89246/example1/after/Example1.hs b/message-index/messages/GHC-89246/example1/after/Example1.hs new file mode 100644 index 00000000..b62ee246 --- /dev/null +++ b/message-index/messages/GHC-89246/example1/after/Example1.hs @@ -0,0 +1,4 @@ +module Example1 where + +main :: IO () +main = print "hello" diff --git a/message-index/messages/GHC-89246/example1/before/Example1.hs b/message-index/messages/GHC-89246/example1/before/Example1.hs new file mode 100644 index 00000000..eabc2541 --- /dev/null +++ b/message-index/messages/GHC-89246/example1/before/Example1.hs @@ -0,0 +1,4 @@ +module Example1 where + +main :: IO {} +main = print "hello" diff --git a/message-index/messages/GHC-89246/example1/index.md b/message-index/messages/GHC-89246/example1/index.md new file mode 100644 index 00000000..dc290a6e --- /dev/null +++ b/message-index/messages/GHC-89246/example1/index.md @@ -0,0 +1,5 @@ +--- +title: Empty record syntax in type constructor argument +--- + +A type constructor such as `IO` can be applied to a type variable, (e.g. `a`), or a type (e.g. `Int`, `[Bool]`, `(a,Int,b->Int)`). `{}` is neither of those. The unit type `()` can be used instead of an empty record type when the return value of the `IO` operation is irrelevant or meant to be discarded. diff --git a/message-index/messages/GHC-89246/index.md b/message-index/messages/GHC-89246/index.md new file mode 100644 index 00000000..24d314ce --- /dev/null +++ b/message-index/messages/GHC-89246/index.md @@ -0,0 +1,17 @@ +--- +title: Illegal record syntax +summary: Empty record syntax is not supported for type constructor arguments +severity: error +introduced: 9.8.1 +--- + +Record syntax can be used for giving names to the arguments of a value constructor in `data` or `newtype` declarations. Record syntax cannot be used in place of type constructor arguments. The reason is that Haskell does not have first class records. Record syntax is merely a shorthand for declaring named projections. + +## Example error text +``` +error: [GHC-89246] + Record syntax is illegal here: {} + | +3 | main :: IO {} + | ^^ +``` diff --git a/message-index/messages/GHC-94803/example1/after/Example.hs b/message-index/messages/GHC-94803/example1/after/Example.hs new file mode 100644 index 00000000..77271cf3 --- /dev/null +++ b/message-index/messages/GHC-94803/example1/after/Example.hs @@ -0,0 +1,4 @@ +module Example where + +a = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(0,0)) diff --git a/message-index/messages/GHC-94803/example1/before/Example.hs b/message-index/messages/GHC-94803/example1/before/Example.hs new file mode 100644 index 00000000..4ed75c25 --- /dev/null +++ b/message-index/messages/GHC-94803/example1/before/Example.hs @@ -0,0 +1,4 @@ +module Example where + +a = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) diff --git a/message-index/messages/GHC-94803/example1/index.md b/message-index/messages/GHC-94803/example1/index.md new file mode 100644 index 00000000..f69f53b1 --- /dev/null +++ b/message-index/messages/GHC-94803/example1/index.md @@ -0,0 +1,8 @@ +--- +title: 65-element tuples +order: 1 +severity: error +introduced: 9.8.1 +--- + +Having too many elements in a tuple causes a compilation error. A workaround is to collect the extra elements in a nested tuple. diff --git a/message-index/messages/GHC-94803/index.md b/message-index/messages/GHC-94803/index.md new file mode 100644 index 00000000..abb40262 --- /dev/null +++ b/message-index/messages/GHC-94803/index.md @@ -0,0 +1,25 @@ +--- +title: Tuple too large +summary: Tuples can only have up to 64 elements +severity: error +introduced: 9.8.1 +--- + +A value containing more than 64 elements needs to be represented in a different way. + +## Example error text +``` +error: [GHC-94803] + • A 65-tuple is too large for GHC + (max size is 64) + Workaround: use nested tuples or define a data type + • In the expression: + (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + In an equation for ‘a’: + a = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0) +```