Why is functional programming important?
- I want to read it after reading Haskell Programming from First Principles.
(Information Science Expert) Haskell, Lisp, OCaml, etc. They focus on how to “generate” data from a given data.
- In contrast, other procedural languages/imperative languages focus on how to “process” data.
Ideal components (PCF):
-
Basic data and their operations
-
Variables
-
Conditional branching
-
Function definitions
- Recursive function definitions
-
Function usage
-
Programs can be represented as graphs
- Values, branches, operators, and functions are represented as vertices in the graph
- Variables are represented as points
-
There are some rules:
- The basic rule is depth-first search
- If you encounter a box, go back once
- When encountering a variable, assign a value to all connections it has