typesafe-monads/monads/functor.py

13 lines
295 B
Python
Raw Normal View History

2018-10-11 05:26:00 +00:00
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
2018-10-11 05:26:00 +00:00
raise NotImplementedError
__mul__ = __rmul__ = map