suned / pfun

Functional, composable, asynchronous, type-safe Python.

Home Page:https://pfun.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow nullary function arguments to and_then when monad produces None

suned opened this issue · comments

E.g this should be ok:

from pfun.maybe import Just
def f():
     return Just(1)

Just(None).and_then(f)

I think the only way to provide correct typing for this is to handle it using the mypy plugin.