Haskelling My Python
a year ago
- #Python
- #Functional Programming
- #Generators
- Introduction to using infinite Python generators inspired by Haskell techniques.
- Demonstration of defining an infinite generator for positive integers recursively.
- Explanation of integrating Taylor series using infinite generators.
- Magic trick: Defining the exponential function as its own integral.
- Comparison of custom exponential function evaluation with Python's standard library.
- Extension to trigonometric functions: defining sine and cosine via integration.
- Performance improvement using memoization to speed up Python generators.
- Bonus: Using Python's fractions module for exact arithmetic.