Algebraic Data Type vs Algebraic Data Structure

Algebraic Data Type:

  1. Product Type
  2. Sum Type: Either

Algebraic Data Structure:

Functor (map) :

Functional Programming Python: Lambdas, Decorators, and Other Magic

Python is multi-paradigm: OO or FP.

Useful Functional Programming Techniques :

  • Closure: local variables
  • Resursion : stop unlimiting looping
  • Lambdas : anonymous function for 1-time throw-away functions
  • Nested Function: function returns a function as result.
  • Decorators : wrap an existing function with additional features without modifying it.