fun pageA () = return A
and fromA r =
let
val forename = r.Forename
fun pageB () = return BPrevious
and pageC' r = pageC (Some r.Surname)
and pageC surname = return C
Hello {[forename]}{case surname of
None =>
| Some s => {[s]}}
{case surname of
None => Previous
| Some _ => Previous}
in
if r.EnterSurname then
pageB ()
else
pageC None
end
fun main () = pageA ()