Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 981 Bytes

File metadata and controls

21 lines (13 loc) · 981 Bytes
layout page
title 401.19 Reading Notes
permalink /401-R19/

Purely Functional Programming

Pure vs. Impure

  • Within functional programming, purity is the goal of mathematical evaluation that is independent of state. Exact definitions vary but tend to focus on the consistent evaluation of a function given the same arguments. Impure functional programming may use data structures or input and output which might evaluate differently given a change in data outside of the function or structure itself.

Advantages of PFP

  • As the order of evaluation will not impact the returns, evaluation of expressions can be delayed until a later reference (lazy evaluation).

  • Lack of interaction between two functions means that the functions may be executed in parallel.

Languagues by Purity