SML code sample