You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that the bind method signature is receive Callable[[S], 'Either[M, T]' which M, and T generic types are from the Either its class.
But I think it should be like this instead...
My Solution
I'm a new Python user, and I'm not an advanced functional programmer.
So, I'm not sure that my solution will break something, or not.
.
.
Let the M, and T generic types refer to generic M, and T of bind method itself.
Either.bind
function doesn't support type hint as wellProblem
The

average
functoion receiveslist[float]
, and returnsEither[ErrorMessage, float]
.So the

avg_result
type should beEither[ErrorMessage, float]
, notEther[ErrorMessage, list[list[str]]]
.But when I use

bind
function, it will return only the type ofEither
source.Reproduce:
https://github.com/fResult/Just-Python/blob/fc32a08509741a5dff6a45d922175890e5a86478/worksheets/csv_use_either.py#L94-L100
Current implementation of the
bind
functionI found that the

bind
method signature is receiveCallable[[S], 'Either[M, T]'
whichM
, andT
generic types are from theEither
its class.But I think it should be like this instead...
My Solution
I'm a new Python user, and I'm not an advanced functional programmer.

So, I'm not sure that my solution will break something, or not.
.
.
Let the
M
, andT
generic types refer to generic M, and T ofbind
method itself.We will get the result of
Either.bind
like this.The text was updated successfully, but these errors were encountered: