4 ms·
I think this is mostly a disagreement around terminology. The GP is referring to purely functional languages like Haskell, where functions don’t have state and
by iainmerrick 7y ago
I think this is mostly a disagreement around terminology.
The GP is referring to purely functional languages like Haskell, where functions don’t have state and are referentially transparent. In Haskell, useState would have to use a monad.
Racket (and Lisp in general) has mutable state so doesn’t guarantee referential transparency. You can definitely write pure functions, and that’s good style in many contexts, but it’s not required or enforced.
I personally agree with the GP, and assume “functional programming” to mean pure functional programming. It’s common to use an FP style in non-pure languages, but I think this is FP if and only if you completely avoid state.