[MLton] Monadic MLton.Vector.create with update

Henry Cejtin henry.cejtin@sbcglobal.net
Thu, 30 Mar 2006 08:18:32 -0600


You can write unfold_vec using the (non-monadic) create, but you need a ref
cell to carry along the state (if you do it in the tabulator) or an initial
value (if you do it in the final thunk).
Note, your unfold_vec throws away the final state (the 'b returned in the
tuple by the last call to the 'b -> 'b * 'a unfolder).