funbox.maybe.maybe_c(f)(val) is equivalent to funbox.passthrough.passnone(f)(val).
funbox.maybe is more general, in that it can take more functions, applying them left to right like in a pipeline. I think that the new interface of 'maybe' makes a chain of more than one or two much easier to read than nested calls to passnone.
maybe_c(f, g, h, ...)(val)
There's also an uncurried version, maybe(), which will be more convenient in the common case that you're not passing the chain of lifted functions as arguments to another higher-order function.
The only thing passnone()() can do that maybe_c()() or maybe() can't is to allow you to change the default return value for the None case:
>>> passnone(lambda x: x.upper(), default='NULL')(None)
'NULL'
That's the only thing that may make it worth keeping.
If I do keep passnone, I'll move it into maybe, but it may have a different name or interface.
If anyone currently uses passnone in this way, please comment below.
funbox.maybe.maybe_c(f)(val) is equivalent to funbox.passthrough.passnone(f)(val).
funbox.maybe is more general, in that it can take more functions, applying them left to right like in a pipeline. I think that the new interface of 'maybe' makes a chain of more than one or two much easier to read than nested calls to passnone.
There's also an uncurried version, maybe(), which will be more convenient in the common case that you're not passing the chain of lifted functions as arguments to another higher-order function.
The only thing passnone()() can do that maybe_c()() or maybe() can't is to allow you to change the default return value for the None case:
That's the only thing that may make it worth keeping.
If I do keep passnone, I'll move it into maybe, but it may have a different name or interface.
If anyone currently uses passnone in this way, please comment below.