-
- Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
We need to be able to work with generic like List[str]
or Result[str, Exception]
and Maybe[int]
I propose the following API:
@typeclass def test(instance) -> int: ... @test.instance( Some[int], predicate=lambda instance: is_successful(instance) and isinstance(instance.unwrap(), int), ) def _test_success_int(instance: Some[int]) -> int: return instance.unwrap()
It should be supported on both side: types and runtime.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed