I have the following SML source file with a trivial function in it:
(* fact.sml *)
fun fact_unguarded 0 = 1
| fact_unguarded n = n * fact_unguarded(n-1)
fun fact 0 = SOME(1)
| fact n = if n > 0 then SOME(n * fact_unguarded(n-1)) else NONE
I'm trying to compile it with MLTon using the C backend and look at the generated C code.
% mlton -codegen c fact.sml
However, none of the intermediate files are dumped in the current working directory and there appears to be nothing relevant in /tmp
either. Is there a way to direct MLTon to either a) produce just the C source file and stop or b) keep intermediate files around even after the final artifact is produced.
% pwd
~/tmp/sml
% ls
fact* fact.sml