Ok, so, after an extended period of time (which, obviously, is my fault), we essentially have one option per opinion (well, I guess 3a and 4 have two, but that's not really what consensus is like). Simon, the other day, advised me to reduce the number of choices based on Shea's preferences. I decided to not include Shea's original proposal of doing the backward incompatible change without extension as I believe that it is contrary to the spirit of the language editions and all that.
I'm calling for a vote on the three following options. As per our customs, this is preference voting please order the following options. If you want to vote against an option, rank it after “That's it” (or omit it altogether). Explanation of the summary below
I'm leaving the vote open until Wednesday 1st May. After which, I'll tally, and synthesise the committee's final position.
2. [Summary: 00WWWN] No change in behaviour, just add a warning when `main` has a type that isn't `main :: IO ()` or `main :: IO Void`, very much including `main :: IO ExitCode` (Shae's second favourite alternative)
3a. [Summary: -XNoWombat: 00WWWW / -XWombat: TTETET] A warning is added as in 2, but, additionally, an extension is introduced. When the extension is turned on, we always call the proposed `ExitStatus` type class on the returned value to determine the program's exit code. (Shae's favourite alternative)
4. [Summary: -XNoWombat: 00000N / -XWombat 00I00N] No warning is introduced, but an extension is. When the extension is turned on, everything is as today, except when `main :: IO ExitCode`, in which case we program's exit code is the exit code returned by `main` (Simon PJ's favourite)
That's it
------
The summaries are based on the following examples. Each get a letter representing the behaviour under the proposal, as described in the legend
The examples:
module Ex1 where { ..; main :: IO Void }
module Ex2 where { ..; main :: IO () }
module Ex3 where { ..;
main :: IO Int }
module Ex4 where { ...; main :: IO ExitCode } -- ExitCode exists already
module Ex5 where { ...; main :: IO Bool } -- No ExitStatus instance for Bool
module Ex6 where { ...; data T = ..; main :: IO T; instance ExitStatus T where ... }
The legend:
- 0: main exits with exit code 0 (success)
- E: type error
- W: a warning is emitted
- T: the `ExitStatus` type class is used to select the exit code.
- I: The exit code is the returned value (only apply to `main :: IO ExitCode`).
- N: not available under this alternative