Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- R = typing.TypeVar('R')
- E = typing.TypeVar('E')
- @sum_type
- class Result(typing.Generic[R, E]):
- """Experimental generic ADT."""
- __slots__ = ()
- Ok: Ctor[R]
- Err: Ctor[E]
- my_result: Result[int, str] = Result.Ok(10)
- @sum_type
- class ConcreteResult:
- __slots__ = ()
- Ok: Ctor[int]
- Err: Ctor[str]
- my_concrete_result: ConcreteResult = ConcreteResult.Ok(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement