[MLton] Monadic MLton.Vector.create with update

Stephen Weeks MLton@mlton.org
Thu, 30 Mar 2006 11:51:04 -0800


> Another generalization that I think would require runtime support would be
> 
> val unfoldi_s: 'b * (int * 'b -> ('a * 'b) option) -> 'a vector
> 
> where the length of the resulting vector is not known, but unfolding 
> terminates by returning NONE.
> I suspect you'd want special runtime support to make this
> efficient. 

What kind of support are you thinking of?  I don't see anything in the
current MLton primitives that would let this be implemented more
efficiently than a double-the-buffer approach, which one can do
without any special support.