Questions on MLton

shivers@cc.gatech.edu shivers@cc.gatech.edu
Fri, 3 Oct 2003 23:52:40 -0400


I have a few newcomer questions about Mlton.

1. I see there are ways to do unsafe vector accesses.
   Is there a way to do unsafe list processing. That is,
   suppose I have my hands on a list *which I know is not empty*.
   I would like to be able to take its head & tail *without* first 
   testing it for nil. In smlnj, I can do this with
     fun snoc (x : 'a list) = (Unsafe.cast x) : ('a * 'a list)

2. Is there a way to control the choice of GC? I am timing some
   ML code, and it does a *lot* of side effects to refs, and I'd
   like to run without a write barrier -- i.e., simple stop&copy,
   with no generational gc.

3. Is there a way simply to time code? The profiler seems like a very
   hairy thing, and I essentially just want to have a little timer
   that I can click on & off when I run the function being timed.
   Or am I fighting the system, and should just suck it up & figure
   out how to extract this functionality from the profiler?

Thanks! Mlton is a fine, fine thing.
    -Olin