[MLton] Monadic MLton.Vector.create with update

Henry Cejtin henry.cejtin@sbcglobal.net
Thu, 30 Mar 2006 11:48:19 -0600


The whole question of wether unfoldi should return the final state, and of
the state being carried is kind of a universal one.  Any time you are walking
through a data structure (building or not), should you add a state arg,
folded over the elements and returned at the end.  It is the same as the
difference between app (or what MLton calls foreach) and fold.

I don't have any good answer, but I know that when I want the extra state
passed (and folded) along, it is a pain if it isn't, and when I don't want
it, it is a pain to include the extra unit's.