I am by no means the best to judge functional programming implementations but I find the examples provided as pretty confusing. The parts where the library is supposed to make things better actually look worse to me. The original Python examples also looks like cherry picked code that was already not written very well.
if user is not None:
balance = user.get_balance()
if balance is not None:
credit = balance.credit_amount()
if credit is not None and credit > 0:
discount_program = choose_discount(credit)
I would probably write the python closer to this for readability. Don't judge me too harshly I just rewrote this quickly.
if user is None:
return
balance = user.get_balance()
if balance is None:
return
credit = balance.credit_amount()
if credit is not None and credit > 0:
discount_program = choose_discount(credit)