I know that
exitWith ExitSuccess
exits the program, but it outputs
*** Exception: ExitSuccess
I am wanting to know if there is way to exit without outputting anything onto the screen?
Expanding the above comments here (Credits to Reid, Bakuriu and Jeffrey). It's highly likely that you are executing the following program in ghci
:
import System.Exit
main :: IO ()
main = exitWith ExitSuccess
Now in terminal:
$ ghci
λ> :load crash.hs -- crash.hs is the filename
λ> main
*** Exception: ExitSuccess
Note that ghci
and ghc
are different. ghci
is used as a REPL for Haskell. The above code when compiled and executed like the following won't produce any message:
$ ghc -o crash crash.hs
$ ./crash
Note that the REPL is invoked through the program named ghci
. For compiling and producing an executable, you have to use a executable named ghc
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With