I think these are correct implementations of the tower of Hanoi.
OCaml
let rec hanoi n source target auxiliary =
if n > 0 then begin
hanoi (n - 1) source auxiliary target;
Printf.printf "Move disk from %s to %s\n" source target;
hanoi (n - 1) auxiliary target source
end
SML fun hanoi n source target auxiliary =
if n > 0 then (
hanoi (n - 1) source auxiliary target;
print ("Move disk from " ^ source ^ " to " ^ target ^ "\n");
hanoi (n - 1) auxiliary target source
)
function definition, if expressions, recursion are more concise in SML, string interpolation is nicer in OCamlI thought having the `let` keyword encompass `fun` and `val.` was needlessly confusing. It's not concise. if `let` can mean so many things why not just do what Haskell did.
Again.. it not "so much more verbose." which was the initial point.
but I concede, my SML code is in fact incorrect.