Re:Carnegie Mellon's intro functional programming lectures a...
by SomeRndName11 on Wednesday November 22, 2023 @05:30AM
(#38377442)
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.
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.