This library provides a functional programming interface for Python.
The Result monad handles the three most common cases in programming:
- computation succeeded
- computation failed
- computation valid, but resulted in nothing
from fpinpy import Result
startValue = Result.of(1).map(lambda x: x + 1).forEachOrFail(lambda x: print(x))
It is based on the work by Pierre-Yves Saumont in his books, Functional Programming in Java (2017) and The Joy of Kotlin (2019).