I did Programming Languages, Part A, (to learn FP semantics) many years ago. It doesn't show I never coded anything in SML, it shows I made a mistake :/ .I no longer have Standard ML on my machine.
I 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.
Functional programmers tend to use recursion instead of explicit loops with implicit state, and it's wise to regard for loops with suspicion since it can't return anything.
Standard ML as the language of instruction is a vehicle for teaching FP semantics, not imperative ones.
Also, Tower of Hanoi is a classic problem that's well suited for recursion.
You do not need to school me about why "for" is not pure functional - as soon as you understand that it is syntactic sugar, you are fine; IO is also impure, so if you insisting in purity then the only option is Haskell.
If you want to be pedantic, in functional programming there is no such a thing as "return value", as there is no such a thing as statement, only expressions. And expressions always _have_ values, they do not _return_ them.
I agree that SML is better for teaching than OCaml no doubt about it.
I mean, it is pointless to continue this conversation; you did not use SML for a long time - I did use it last time last year, and I can attest, it is extremely impractical compared to any other FP language today.
I 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.