How can I return success or failure in the operating system in Haskell?

The simplest Unix tools are true and false , small programs that do nothing but return 0 and 1, respectively, to the operating system and exit. An example in C might look like this:

 // true - does nothing successfully int main(void) { return 0; } 

Thanks to the search, I could not find a way to implement such functionality in Haskell. Is there anything in the IO monad that can do this?

+4
source share
3 answers

Use one of the functions defined in System.Exit .

+9
source
+8
source

There are several exit functions that you should use.

+7
source

All Articles