File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,6 @@ def lazy_begin0(*bodys):
9999 body ()
100100 return out
101101
102- # TODO: test multiple-return-values support in all function composition utilities (`curry`, `compose` family, `pipe` family)
103102# TODO: expand tests of `continuations` to cases with named return values
104103# TODO: update code examples in docs
105104
Original file line number Diff line number Diff line change @@ -311,6 +311,17 @@ def mymul_typed(y: int):
311311 test [inc2_then_double (3 ) == 10 ]
312312 test [double_then_inc2 (3 ) == 8 ]
313313
314+ with testset ("compose with multiple-return-values, named return values" ):
315+ f = lambda x , y : Values (2 * x , 3 * y )
316+ g = lambda x , y : Values (x + 2 , y + 3 )
317+ f_then_g = composel (f , g )
318+ test [f_then_g (1 , 2 ) == Values (4 , 9 )]
319+
320+ f = lambda x , y : Values (x = 2 * x , y = 3 * y )
321+ g = lambda x , y : Values (x = x + 2 , y = y + 3 )
322+ f_then_g = composel (f , g )
323+ test [f_then_g (1 , 2 ) == Values (x = 4 , y = 9 )]
324+
314325 with testset ("curry in compose chain" ):
315326 def f1 (a , b ):
316327 return Values (2 * a , 3 * b )
You can’t perform that action at this time.
0 commit comments