mirror of
https://github.com/correl/typesafe-monads.git
synced 2024-11-25 11:09:57 +00:00
12 lines
295 B
Python
12 lines
295 B
Python
from __future__ import annotations
|
|
from typing import Any, Callable, Generic, TypeVar
|
|
|
|
T = TypeVar("T")
|
|
S = TypeVar("S")
|
|
|
|
|
|
class Functor(Generic[T]):
|
|
def map(self, function: Callable[[T], S]) -> Functor[S]: # pragma: no cover
|
|
raise NotImplementedError
|
|
|
|
__mul__ = __rmul__ = map
|