Exit process using both MLton and MosML (Process module missing)

80 views Asked by At

I am trying to write code that will compile on either mlton or mosml.

In my mosml I can exit on failure as follows.

Process.exit(Process.failure)

However when I try to reuse the same code and compile on mlton. It cannot find Process in its library set. Please let me know my options in terms of writing code that will work on either platform within one source code file.

1

There are 1 answers

1
Andreas Rossberg On

The Process structure is a substructure of OS, so the following should work:

OS.Process.exit OS.Process.failure

See the Basis Library specification.