Is your feature request related to a problem? Please describe.
There are times when I have to call a function in an uncertain state, and I use it in the following way.
import expression as ex
def func(a: int, b: str):
return [a, b]
def get_func():
return ex.Ok(func)
func_result = get_func()
value = func_result.map(lambda f: f(1, "test"))
It doesn't matter if it's a simple case.
But, if it overlaps a little bit, it's quite a hassle.
Describe the solution you'd like
I think there are two ways
import expression as ex
def func(a: int, b: str):
return [a, b]
def get_func():
return ex.Ok(func)
func_result = get_func()
value = helper_func(func_result, 1, "asd")
or
import typing as tp
import expression as ex
def func(a: int, b: str, c: ex.Result[int, tp.Any]):
return [a, b]
def get_func():
return ex.Ok(func)
func_result = get_func()
value = ex.pipe(
func_result,
func_helper.map(1),
func_helper.map("asd"),
func_helper.bind(123),
)
Describe alternatives you've considered
I'm using the second method as follows, but I don't think it's pythonic.
Is your feature request related to a problem? Please describe. There are times when I have to call a function in an uncertain state, and I use it in the following way.
It doesn't matter if it's a simple case. But, if it overlaps a little bit, it's quite a hassle.
Describe the solution you'd like I think there are two ways
or
Describe alternatives you've considered I'm using the second method as follows, but I don't think it's pythonic.
do not use below, too many bugs.
I would appreciate it if you could let me know if there is a good method that you have already provided.
Additional context Add any other context or screenshots about the feature request here.