3 ms·
The example of summation is really what "fold" in functional programming languages does. Pure functional programming is close to the idea of mathematical notati
by theoh 9y ago
The example of summation is really what "fold" in functional programming languages does. Pure functional programming is close to the idea of mathematical notation, particularly in the sense that "equational reasoning" is possible.
Another functional idea related to the concepts you mentioned is the "where" clause:
"A notationally distinctive feature of ISWIM is its use of “where” clauses. An ISWIM program is a single expression qualified by “where” clauses (auxiliary definitions including equations among variables), conditional expressions and function definitions. Along with CPL, ISWIM was one of the first programming languages to use “where” clauses." (From the page for ISWIM on Wikipedia)
If this sounds good, see Haskell etc.