Skip to content

Comment on Functional Programming in Pythonparent

Comments

I'm also a FP fanboy, and this concept doesn't quite convince me. I'm not sure a Maybe type really helps that much in a dynamically typed language. All the safety you get from using Maybes is worth Nothing (pun intended) when credit_amount could still return let's say Just a string, or raises an exception.

If this chain of calls supposedly handles Nones at any level, then .map is not the right method. It should be .flatMap (or .bind). Unless this is a magic .map that handles either X or Maybe[X] and even exceptions (just like JS promises). This flexibility may be convenient and I can appreciate its pythonicness, but it's not really in the spirit of typed FP.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.