What does “pure” mean in “pure functional language”?

前端 未结 7 1828
醉梦人生
醉梦人生 2020-11-30 19:47

Haskell has been called a \"pure functional language.\"

What does \"pure\" mean in this context? What consequences does this have for a programmer?

相关标签:
7条回答
  • 2020-11-30 20:45

    As there cannot be any side effects in pure functional code, testing gets much easier as there is no external state to check or verify. Also, because of this, extending code may become easier.

    I lost count of the number of times I had trouble with non-obvious side effects when extending/fixing (or trying to fix) code.

    0 讨论(0)
提交回复
热议问题