We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There's a common use-case when we need to create a type-class with several methods. Like:
class Functor(Protocol[T]): def map(self, function: Callable[[T], Functor[V]]) -> Functor[V]: ... @classmethod def from_value(cls, inner_value: V) -> Functor[V]: ...
Currently, there's no way we can do that.
I propose something like this:
@typeclass class Functor(Protocol[T]): def map(self, function: Callable[[T], Functor[V]]) -> Functor[V]: ... @classmethod def from_value(cls, inner_value: V) -> Functor[V]: ...
I am not sure how to bound it to the actual implementation.
The text was updated successfully, but these errors were encountered:
@Functor.instance class Maybe(Generic[T]): def map(self, function: Callable[[T], Maybe[V]]) -> Maybe[V]: ... @classmethod def from_value(cls, inner_value: V) -> Maybe[V]: ...
Sorry, something went wrong.
How is it different from a simple protocol?
Supports[]
No branches or pull requests
There's a common use-case when we need to create a type-class with several methods. Like:
Currently, there's no way we can do that.
I propose something like this:
I am not sure how to bound it to the actual implementation.
The text was updated successfully, but these errors were encountered: