Skip to content

Commit

Permalink
feat(ch06): add functional programming theory
Browse files Browse the repository at this point in the history
  • Loading branch information
poulzinho committed Dec 29, 2019
1 parent 682023c commit 1739237
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/ch-06_what-is-fp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# What is Functional Programming?

## Functional Programming
- Programming paradigm
- Apps are composed
- Using Pure functions
- Avoiding shared mutable state
- Without side-effects
- More declarative than imperative

### Pure Functions
- Same inputs always return the same output
- No side-effects

* Referential transparency, replace a function call with a value does not affect the programm.

### Function Composition
- Combine two or more functions into one
```
f(g(x))
```

### Shared State
- Race condition
- Different results depending on the order in which functions are called

* By avoiding shared state, timing and order of function calls do not affect the result




0 comments on commit 1739237

Please sign in to comment.