Is there some way (flag or hack) to make GHC accept a main module where the main function’s signature isn’t IO ()? For Fay the main functions have the type Fay (), but GHC does not accept this if the module is Main (or the module name is left out).
Is there some way (flag or hack) to make GHC accept a main module
Share
The entry point to the programme must have type
IO afor somea, and as far as I know, there is no way to make GHC accept other types (without modifying its source code).By default the entry point is
Main.main, but you can specify different actions as entry points using the-main-isflag with GHC. The general form isYou can omit the
Modulepart if the module isMain,or the
actionpart, if its name ismain,is equivalent to
-main-is Module.main.For your case, you can add a dummy action to the
Mainmodule, or a dummy module – that of course needs to be imported (directly or indirectly) from theMainmodule – to the programme to stand in as the entry point as far as GHC is concerned.