4 ms·
> However, large-scale systems almost always have state Managing state is a central part of what FP systems do; a normal Haskell program is, in a sense, a func
by dragonwriter 8y ago
> However, large-scale systems almost always have state
Managing state is a central part of what FP systems do; a normal Haskell program is, in a sense, a function that returns an imperative program for handling stateful interaction. The stateful and stateless parts are clearly distinguished so that the problems associated with state can be managed more effectively and don't make it hard to reason about parts of the program that have no reason to be state-sensitive.
While the mechanisms are different, that separation seems broadly the point of most pure FP systems and many impure ones.
- pubby 8y agoWriting stateful code in Haskell is super clunky though. State monads and lens? - Yuck! I'd take an OO language over that mess any day.
- cannabis_sam 8y agoState Monads and lens are just libraries though, and only one of many ways to deal with stateful code in Haskell. OOP, on the other hand, is clunky as a concept...