Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add index entries for GHC-67120, GHC-89246, and GHC-94803 #517

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jllang
Copy link

@jllang jllang commented Jun 8, 2024

No description provided.

@jllang jllang changed the title Add index entry for GHC-94803 Add index entry for GHC-94803 and GCH-67120 Jun 9, 2024
@jllang jllang changed the title Add index entry for GHC-94803 and GCH-67120 Add index entries for GHC-94803 and GCH-67120 Jun 9, 2024
@jllang jllang changed the title Add index entries for GHC-94803 and GCH-67120 Add index entries for GCH-67120, GHC-89246, and GHC-94803 Jun 10, 2024
@jllang jllang changed the title Add index entries for GCH-67120, GHC-89246, and GHC-94803 Add index entries for GHC-67120, GHC-89246, and GHC-94803 Jun 28, 2024
introduced: 9.8.1
---

According to the second paragraph of Chapter 5 of The Haskell 98 Report,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),

---

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -0,0 +1,3 @@
---
title: <insert a title for this example here>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fill the title?

@@ -0,0 +1,6 @@
module Main where
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants