Does functional programming avoid state?

前端 未结 4 1701
死守一世寂寞
死守一世寂寞 2021-02-01 20:44

According to wikipedia: functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state an

4条回答
  •  日久生厌
    2021-02-01 20:53

    The Wikipedia definition is correct. It may seem puzzling at first, but if you start working with say Haskell, you'll note that you don't have any variables laying around containing values.

    State can still be sort of represented using state monads.

提交回复
热议问题