Skip to content

Commit a305b33

Browse files
authored
Add GHC-67120 main not defined
1 parent 423843b commit a305b33

File tree

1 file changed

+16
-0
lines changed
  • message-index/messages/GHC-67120

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: ‘main’ not defined
3+
summary: The IO action ‘main’ is not defined in module ‘Main’.
4+
introduced: 9.8.1
5+
severity: error
6+
---
7+
8+
GHC expects the `Main` module to define a function called `main` which it can use as the entry point of your program.
9+
10+
This error can also occur in unnamed modules, because GHC will default to the module name `Main` for such modules.
11+
12+
If you just want GHC to produce an object file without an entry point, then you can give your module a name other than `Main` by putting a module header at the top of your file (below language pragmas and compiler options), for example as follows:
13+
14+
```
15+
module Foo where
16+
```

0 commit comments

Comments
 (0)