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

Complete the documentation of main-is field #10833

Merged
merged 1 commit into from
Mar 20, 2025
Merged

Complete the documentation of main-is field #10833

merged 1 commit into from
Mar 20, 2025

Conversation

mpilgrem
Copy link
Collaborator

The motivation is the discussion at this Stack issue:

where a user wanted to use Foo.hs containing Foo.main and expected Cabal's main-is field to interpret that.

Explains the use of GHC's -main-is option in Cabal files, when the usual convention of Main.main is not being followed.

This PR does not modify behaviour or interface

  • Patches conform to the coding conventions.
    Not applicable, but style of surrounding text is followed.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).
    Not applicable.

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

That's an improvement, thanks! Could you replace - with proper em-dashes if you really want dashes? Dash is a little tricky, and I'd simply use a comma or full stop depending on the context, but it's up to you. Also 'main' with single quotes looks strange to my eye --- I'd use double quotes or the code backticks. But again, it's a slippery place.

@mpilgrem mpilgrem force-pushed the main-is-fix branch 2 times, most recently from 998012c to a736bb3 Compare March 16, 2025 10:20
@mpilgrem
Copy link
Collaborator Author

@ulysses4ever, to avoid some long sentences, I've taken a slightly different approach. I've added two short sentences of introductory context, boiled down from the introduction to Chapter 5 of the Haskell Language Report, except that I have used the phrase "IO action" rather than "computation of type IO τ for some type τ". (While "IO action" could be said to be "Haskell jargon", I think it is a term that is encountered early on when you learn about Haskell's approach to I/O - and you have to learn that approach to write a Haskell program.) This allows me to refer to 'the convention' and 'the relevant IO action' later in the text.

@andreasabel andreasabel added documentation re: main Concerning the `main-is` field labels Mar 17, 2025
@ulysses4ever ulysses4ever added the merge me Tell Mergify Bot to merge label Mar 18, 2025
@ulysses4ever
Copy link
Collaborator

Thanks for addressing the comments! I went ahead and put the merge label.

@mergify mergify bot added the ready and waiting Mergify is waiting out the cooldown period label Mar 18, 2025
@ulysses4ever
Copy link
Collaborator

we may even consider backporting it to 3.14...

@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Mar 20, 2025
Explains the use of GHC's `-main-is` option in Cabal files, when the usual convention of `Main.main` is not being followed.
@mergify mergify bot merged commit 7e0acf7 into master Mar 20, 2025
17 checks passed
@mergify mergify bot deleted the main-is-fix branch March 20, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attention: needs-backport 3.14 documentation merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge re: main Concerning the `main-is` field ready and waiting Mergify is waiting out the cooldown period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants