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

前端 未结 7 1849
醉梦人生
醉梦人生 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:29

    Amr Sabry wrote a paper about what a pure functional language is. Haskell is by this definition considered pure, if we ignore things like unsafePerformIO. Using this definition also makes ML and Erlang impure. There are subsets of most languages that qualify as pure, but personally I don't think it's very useful to talk about C being a pure language.

    Higher-orderness is orthogonal to purity, you can design a pure first-order functional language.

提交回复
热议问题