Open mbertheau opened 9 years ago
This issue was opened 7 years ago.
If there was a problem, it's probably fixed. This runs without errors:
@curry
def f(x: int, y: int) -> int:
return x + y
def test_curry() -> None:
assert f(1, 2) == 3
assert f(1)(2) == 3
def test_pipe_curried() -> None:
assert pipe(1, f(2)) == 3
assert pipe(1, f(2), f(3)) == 6
def test_compose_curried() -> None:
assert compose(f(2), f(3))(1) == 6
Composing a curried function with removes the currying. It can easily be re-added by re-applying
curry
, but maybe that should happen automatically.