Category:Programming paradigm/Functional: Difference between revisions
Content added Content deleted
(tightened up language) |
(Broken link repaired) |
||
Line 4: | Line 4: | ||
# This makes dependencies explicit. |
# This makes dependencies explicit. |
||
# This leads to [http://www.haskell.org/haskellwiki/Referential_transparency referential transparency] -- given the same arguments, a piece of code will always behave identically. |
# This leads to [http://www.haskell.org/haskellwiki/Referential_transparency referential transparency] -- given the same arguments, a piece of code will always behave identically. |
||
# Coding is '''compositional''' -- any two pieces of code with a matching 'interface', as specified by function domains, can be combined, because no hidden side-effects can intervene. (See [ |
# Coding is '''compositional''' -- any two pieces of code with a matching 'interface', as specified by function domains, can be combined, because no hidden side-effects can intervene. (See [https://www.thocp.net/biographies/papers/backus_turingaward_lecture.pdf ''Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs''] by John Backus, 1977 Turing Award Lecture). |
||
# It's easy to '''refactor''' similar pieces of code, because any subexpression can be replaced by a variable bound at the outside. |
# It's easy to '''refactor''' similar pieces of code, because any subexpression can be replaced by a variable bound at the outside. |
||