mirror of
https://github.com/correl/typesafe-monads.git
synced 2024-11-25 11:09:57 +00:00
14 lines
335 B
Python
14 lines
335 B
Python
import pytest # type: ignore
|
|
from typing import Callable, TypeVar
|
|
|
|
from monads import Applicative
|
|
from .fixtures import monad
|
|
|
|
T = TypeVar("T")
|
|
S = TypeVar("S")
|
|
|
|
|
|
def test_fmap_using_ap(monad) -> None:
|
|
f: Callable[[int], int] = lambda x: x + 1
|
|
m: Applicative[int] = monad.pure(3)
|
|
assert m.map(f) == m.apply(monad.pure(f))
|