-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
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
Typeclasses with several methods #83
Labels
Comments
sobolevn
added
enhancement
New feature or request
help wanted
Extra attention is needed
labels
Jun 24, 2020
@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]:
... |
How is it different from a simple protocol? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: