|
|
|
|
|
by bnegreve
4446 days ago
|
|
According to Wikipedia, functional programming is an example of declarative programming [1], which is mentioned in the article. This is not immediately obvious to me, here's why (from the same wikipedia article [1]): While functional languages typically do appear to specify "how", a compiler for a purely functional programming language is free to extensively rewrite the operational behavior of a function, so long as the same result is returned for the same inputs. This can be used to, for example, make a function compute its result in parallel, or to perform substantial optimizations (such as deforestation) that a compiler may not be able to safely apply to a language with side effects. [1] http://en.wikipedia.org/wiki/Declarative_programming |
|