3 ms·
> State machines are also intrinsically stateful, that should be obvious. So are lots of data types, but those are still useful in FP.
by tytytytytytytyt 9y ago
> State machines are also intrinsically stateful, that should be obvious.
So are lots of data types, but those are still useful in FP.
- seanmcdirmid 9y agoYes, that should be obvious also. State machines have no strong relationship with FP. I'm not sure where this claim even comes from!
- noblethrasher 9y agoIn 's4vi0r’s defense, “FP” usually means ML-style FP, which does happen to be pretty biased towards creating stack-based FSMs since it has literal syntax for stacks (list literals), states (discriminated unions + tuples), and transitions (pattern matching).
- coldtea 9y ago>“FP” usually means ML-style FP Only after sometime around 2010. Before that it was mostly Lisp and Scheme. Sometime around then, the trend around Haskell, purity, and co overtook them as what people mean when they talk about FP.
- throwaway010317 9y agoThis comment reminds me of something I read recently on Yaron Minsky's twitter: "An odd habit of functional programmers: when confronted with a nice, but clearly imperative way of structuring a program, they will often declare that this technique is in fact functional." (https://twitter.com/yminsky/status/950883335324225541 https://twitter.com/yminsky/status/950883335324225541) and then "Case in point: structuring a program as an imperative, deterministic state machine, where the state is determined fully by the state machine logic plus the sequence of transactions." (https://twitter.com/yminsky/status/950883598189686784 https://twitter.com/yminsky/status/950883598189686784)