Add index entries for GHC-67120, GHC-89246, and GHC-94803#517
Open
jllang wants to merge 3 commits intohaskellfoundation:mainfrom
Open
Add index entries for GHC-67120, GHC-89246, and GHC-94803#517jllang wants to merge 3 commits intohaskellfoundation:mainfrom
jllang wants to merge 3 commits intohaskellfoundation:mainfrom
Conversation
Bodigrim
reviewed
Feb 2, 2025
| introduced: 9.8.1 | ||
| --- | ||
|
|
||
| According to the second paragraph of Chapter 5 of The Haskell 98 Report, |
Collaborator
There was a problem hiding this comment.
Suggested change
| According to the second paragraph of Chapter 5 of The Haskell 98 Report, | |
| According to the second paragraph of Chapter 5 of [The Haskell 2010 Report](https://www.haskell.org/onlinereport/haskell2010/haskellch5.html#x11-980005), |
Bodigrim
reviewed
Feb 2, 2025
| --- | ||
|
|
||
| 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. |
Collaborator
There was a problem hiding this comment.
Suggested change
| > 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. | |
| > 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. |
Bodigrim
reviewed
Feb 2, 2025
| @@ -0,0 +1,3 @@ | |||
| --- | |||
| title: <insert a title for this example here> | |||
Collaborator
There was a problem hiding this comment.
Could you please fill the title?
Bodigrim
reviewed
Feb 2, 2025
| @@ -0,0 +1,6 @@ | |||
| module Main where | |||
Collaborator
There was a problem hiding this comment.
My experience is that it's far more common reason for GHC-67120 that you meant to write a library exporting notMain, in which case the solution is to rename module Main to module Lib or anything.
What contributes to the problem is that GHC would assume module Main where implicitly unless there is module declaration.
Probably worth adding another example or at least discussing this case in index.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.