GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2020-03-22T17:02:46Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/17171`runghc` accepts invalid main program (for GHC 8.8.1)2020-03-22T17:02:46ZHerbert Valerio Riedelhvr@gnu.org`runghc` accepts invalid main program (for GHC 8.8.1)Consider the `Main` module
```
module Main () where main = putStrLn "The impossible happened"
```
which according to the Haskell Report does not constitute a valid Haskell Program (as it doesn't export the `main` entry point)
Compilin...Consider the `Main` module
```
module Main () where main = putStrLn "The impossible happened"
```
which according to the Haskell Report does not constitute a valid Haskell Program (as it doesn't export the `main` entry point)
Compiling this with `ghc --make` will rightly reject it with
```
Main.hs:1:1: error:
The IO action ‘main’ is not exported by module ‘Main’
|
1 | module Main () where main = putStrLn "The impossible happened"
| ^
```
However, `runghc Main.hs` (starting with GHC 8.8.1) will happily run this invalid program:
```
$ runghc Main.hs
The impossible happened
```
This inconsistent behaviour has lead to less informed people assuming such a program might be actually "valid" Haskell.8.8.2Roland SennRoland Senn