Introductory workshop on functional programming principles and techniques.
Topics to cover:
- why functional? -- parallelism -- raised level of abstraction -- less mental strain (less state)
- coming from OOP -- functional interfaces (strategies) -> functions -- no getters and setters -- naked data -- no control structures (if, for, Maybe-monad, Error-monad)
- pure functions (referential transparency)
- first-class function VS. higher-order function VS. lambda expression VS. closure
- immutable data structures
- immutable collections
- filter/map/reduce
- Groovy basic syntax
- Groovy collection operations (findAll/collect/inject)
- take/drop
- function composition (<<)
- zip (transpose)
- currying
- head/tail and recursion (e.g. to implement filtering without ifs and loops)
- memoization
- lazy evaluation and lazy collections
- infinite structures