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

Type of main #138

Open
LeventErkok opened this issue Dec 8, 2023 · 0 comments
Open

Type of main #138

LeventErkok opened this issue Dec 8, 2023 · 0 comments
Labels
Typo Typographical or grammatical errors in the text

Comments

@LeventErkok
Copy link

This section suggests main can only have 3 different types:

An `IO` action `main` is executed when the program starts.
`main` can have one of three types:
* `main : IO Unit` is used for simple programs that cannot read their command-line arguments and always return exit code `0`,
* `main : IO UInt32` is used for programs without arguments that may signal success or failure, and
* `main : List String → IO UInt32` is used for programs that take command-line arguments and signal success or failure.

I think main : List String → IO Unit is a 4th alternative, which lean seems to accept just fine.

Not a terribly important point, but I was confused as to why that wouldn't be allowed. Would be good to clarify.

@LeventErkok LeventErkok added the Typo Typographical or grammatical errors in the text label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typo Typographical or grammatical errors in the text
Projects
None yet
Development

No branches or pull requests

1 participant