Closed countvajhula closed 4 years ago
Merging #136 into master will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #136 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 846 846
=========================================
Hits 846 846
Impacted Files | Coverage Δ | |
---|---|---|
arguments/main.rkt | 100.00% <100.00%> (ø) |
|
mock/private/base.rkt | 100.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1a27bb7...38ee4c9. Read the comment docs.
With the changes in this PR, the downstream module referenced in #134 would look like this: https://github.com/countvajhula/relation/commit/e1917f75308843bed81df09c0fa08f59eb96caa6
See discussion in #134
This is a WIP PR to implement a possible way of addressing #134 , and needs input on whether it makes sense, is appropriate for inclusion in the arguments package, is a good solution, etc.
The essential change is to decompose
positional
arguments into two setsleft
andright
, to be able to represent argument sets in curried functions.a
andb
, we simply compose thepositional
lists in the order supplied. With both left- and right-handed positional arguments, we could naively doleft(a) ++ left(b) and right(a) ++ right(b)
, but somehow, it seems more correct to compose them asleft(a) ++ left(b) and right(b) ++ right(a)
, i.e. with the order of composition reversed for the right-sided positional arguments. This seems to make sense if we treat the order of arguments provided toarguments-merge
as "priority" of arguments. When we left-curry a function and provide additional arguments in sequence, each new argument takes up the left-most position not already claimed. Likewise with right-curry, each fresh argument takes up the right-most position not already claimed. It feels like argument composition ought to mirror this behavior, but I'm not sure. In any case that's the composition strategy in this PR at the moment.