Algebraic Data Type vs Algebraic Data Structure

Algebraic Data Type:

  1. Product Type
  2. Sum Type: Either

https://jrsinclair.com/articles/2019/algebraic-data-types-what-i-wish-someone-had-explained-about-functional-programming/

Algebraic Data Structure:

Functor (map) :

Functional Programming Python: Lambdas, Decorators, and Other Magic

https://dev.to/codemouse92/dead-simple-python-lambdas-decorators-and-other-magic-5gbf

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.