mirror of
https://github.com/correl/typesafe-monads.git
synced 2024-11-14 19:19:32 +00:00
17 lines
554 B
Python
17 lines
554 B
Python
from __future__ import annotations
|
|
from typing import Any, Callable, Generic, TypeVar
|
|
|
|
from .applicative import Applicative
|
|
from .functor import Functor
|
|
|
|
T = TypeVar("T")
|
|
S = TypeVar("S")
|
|
|
|
|
|
class Monad(Applicative[T]):
|
|
# FIXME: Callable return type set to Any, as the proper value
|
|
# (Monad[S]) is reported as incompatible with subclass
|
|
# implementations due to a flaw in mypy:
|
|
# https://github.com/python/mypy/issues/1317
|
|
def bind(self, function: Callable[[T], Any]) -> Monad[S]: # pragma: no cover
|
|
raise NotImplementedError
|