Re:Correctness – A paradigm for sustainable software develop...
by pubby on Friday April 05, 2019 @10:04PM
(#19588701)
Writing stateful code in Haskell is super clunky though. State monads and lens? - Yuck! I'd take an OO language over that mess any day.
Re:Correctness – A paradigm for sustainable software develop...
by cannabis_sam on Saturday April 06, 2019 @12:09AM
(#19589164)
State 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...
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.