Are side-effects possible in pure functional programming

后端 未结 9 1018
一个人的身影
一个人的身影 2020-12-14 02:53

I have been trying to wrap my head around functional programming for a while now? I have looked up lambda calculus, LISP, OCML, F# and even combinatorial logic but the main

9条回答
  •  遥遥无期
    2020-12-14 03:05

    The only completely pure functional language I know of is the template system in C++. Haskell takes second place by making the imperative portions of the program explicit.

    In Haskell the program has mutable state, but functions (almost always) don't. You keep like 99% percent of program pure, and only the portion that interacts with the outside world is impure. Therefore when you are testing a function, you know there are no side effects. Pure core, with an impure shell.

提交回复
热议问题