The entry point to the program must be of type IO a for some a , and as far as I know, there is no way to force the GHC to accept other types (without changing its source code).
The default entry point is Main.main , but you can specify various actions as entry points using the -main-is flag with GHC. General form
ghc -main-is Module.action ModuleThatImportsEverything.hs -o programme
You can omit the Module part if the Main module,
ghc -main-is action ModuleThatImportsEverything.hs -o programme
or action if its name is Main ,
ghc -main-is Module ModuleThatImportsEverything.hs -o programme
equivalent to -main-is Module.main .
In your case, you can add a dummy action to the Main module or a dummy module, which, of course, needs to be imported (directly or indirectly) from the Main module - into the program in order to become an entry point with respect to the GHC.
source share