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 am trying to compile it using MLTon using a C server 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 appear to /tmp
be of no significance. Is there a way to direct MLTon to: a) create only the original C file and stop it, or b) save intermediate files even after creating the final artifact.
% pwd
~/tmp/sml
% ls
fact* fact.sml
source
share