Minor whitespace changes
This commit is contained in:
parent
1c3558828d
commit
c3e5146029
|
@ -24,6 +24,7 @@ def c(f2: Callable[[B], C], f1: Callable[P, B]) -> Callable[P, C]:
|
||||||
|
|
||||||
>>> double = lambda x: x + x
|
>>> double = lambda x: x + x
|
||||||
>>> succ = lambda x: x + 1
|
>>> succ = lambda x: x + 1
|
||||||
|
|
||||||
>>> c(double, succ)(1)
|
>>> c(double, succ)(1)
|
||||||
4
|
4
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ def flip(f: Callable[P1, Callable[P2, C]]) -> Callable[P2, Callable[P1, C]]:
|
||||||
`flip` if the arguments you want to flip are not curried.
|
`flip` if the arguments you want to flip are not curried.
|
||||||
|
|
||||||
>>> pair = lambda x: lambda y: (x, y)
|
>>> pair = lambda x: lambda y: (x, y)
|
||||||
|
|
||||||
>>> pair(1)(2)
|
>>> pair(1)(2)
|
||||||
(1, 2)
|
(1, 2)
|
||||||
|
|
||||||
|
@ -82,7 +84,6 @@ def replace(replace_with: A) -> Callable[..., A]:
|
||||||
>>> always_seven = replace(7)
|
>>> always_seven = replace(7)
|
||||||
>>> always_seven(2)
|
>>> always_seven(2)
|
||||||
7
|
7
|
||||||
|
|
||||||
>>> always_seven('hello', 'world!')
|
>>> always_seven('hello', 'world!')
|
||||||
7
|
7
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue