How to return the success or failure of the operating system in Haskell?

The simplest Unix tools are real and fake. There are only a few programs that do nothing. They can only return 0 and 1 respectively to the operating system and exit. Examples in C It might look like this:

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

After searching, I can’t find a way to implement this kind of functionality in Haskell. Is there anything that can be done in the IO monad?

Use one of the functions defined in System.Exit.

< p>The simplest Unix tools are real and fake. There are only a few programs that do nothing. They can only return 0 and 1 to the operating system and exit. An example in C might look like this:

< /p>

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

Pass Searching, I can’t find a way to implement this kind of functionality in Haskell. Is there anything that can be done in the IO monad?

Use one of the functions defined in System.Exit.

Leave a Comment

Your email address will not be published.