[MLton] sequenceNonUnit

Henry Cejtin henry.cejtin@sbcglobal.net
Thu, 28 Jul 2005 18:37:49 -0500

If  you look in figure 15 (Derived forms of expressions) of the SML standard,
it says that

    while exp1 to exp2

is expanded to

    let val rec vid =
                   fn () => if exp1
                               then (exp2; vid ())
                               else ()
    in vid ()

That is why the sequenceUnit option causes the error.

Probably this should be mentioned on the Wiki page, but I like  the  behavior
and  it  seems  to  be correct.  After all, the whole point is warning people
about non-unit expressions used in a context where the value is `ignored'.