Core.ExitSourcetypes for exit status with lots of extra info for fun and profit.
including the Unix status type here so you don't have to import it extra.
This is a type you have my full permission to dig around in. I included the pid in the exit status and I will tell you why: I don't know.
Still, could be useful if you're registering PIDs in a map or something and you want to act on items in the map based on the exit status. I don't know. Anyway, it's there if you want it.
Obligatory pretty printer, for your debugging pleasure.
A function to turn a non-zero exit status into an Error Exit.t and zero into an Ok 'a value. Exit.t * 'a happens to be the return type of Exec.in_context, so this is a helper function to convert that type to a result.
Same as above, only it raises Subprocess_error on non-zero.
Helper function to convert your Exit.t monads into string monads so they compose a little better.