One potential difference between the two is that the current behavior
allows the `Main` module to import `main` from another module, while the
new behavior would fail in that case.
For example, a file that has only a single line:
import SomeOtherModule(main)
This still seems like a fairly
you're inside the module, so you have access to all top-level
bindings, not just to the export list.
the issue with the implicit `module Main(main) where` is that it
errors if main is not defined, even though that's a perfectly harmless
situation.
(i hope i got the question right?)
On Tue,
Markus Trippelsdorf writes:
> On 2017.05.15 at 22:47 -0400, Ben Gamari wrote:
>>
>>
>> The GHC team is very pleased to announce the second candidate of the
>> 8.2.1 release of the Glasgow Haskell Compiler. Source and binary
>> distributions are available at
>>
>>
GHCIs current behavior seems inconsistent with this, why is foo accessible
and why don't I get an unused warning like i do if i have an explicit
`module Main (main) where`?
```
$ cat Main.hs
main :: IO ()
main = pure ()
foo :: Int
foo = 1
$ ghci Main.hs -Wall
GHCi, version 8.0.2:
Agreed, this sounds sensible.
Can anyone think of any unintended consequences?
-Jose
On Tue, May 16, 2017, at 09:50 AM, Iavor Diatchki wrote:
> That seems fairly reasonable to me.
>
> -Iavor
>
> On Tue, May 16, 2017 at 7:18 AM, Joachim Breitner breitner.de> wrote:>> Hi,
>>
That seems fairly reasonable to me.
-Iavor
On Tue, May 16, 2017 at 7:18 AM, Joachim Breitner
wrote:
> Hi,
>
> a very small proposal to be considered for Haskell':
>
> Currently, the report states
>
> An abbreviated form of module, consisting only of the module
Hi,
a very small proposal to be considered for Haskell':
Currently, the report states
An abbreviated form of module, consisting only of the module body,
is permitted. If this is used, the header is assumed to be ‘module
Main(main) where’.
I propose to change that to
An
CALL FOR PAPERS
19th International Symposium on
Principles and Practice of Declarative Programming
PPDP 2017
Namur, Belgium, October 9-11,