SML# Document Version 3.7.1
19 Expressions

19.17 While expression while exp1 do exp2

This is for imperative iterations. exp1 must be of bool type. The type of this expression is unit. This expression iterates the evaluation of exp2 while exp1 is evaluated to true. If exp1 is evaluated to false, it returns ().