Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make bind work with keyword functions #1

Merged
merged 2 commits into from
Jun 18, 2020
Merged

Conversation

jw3126
Copy link
Contributor

@jw3126 jw3126 commented Jun 17, 2020

I like the elegant implementation in your package a lot. Here is some better keyword support.

@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2020

Codecov Report

Merging #1 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #1   +/-   ##
=======================================
  Coverage   90.90%   90.90%           
=======================================
  Files           1        1           
  Lines          11       11           
=======================================
  Hits           10       10           
  Misses          1        1           
Impacted Files Coverage Δ
src/Curry.jl 90.90% <100.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 ca0d343...3736988. Read the comment docs.

src/Curry.jl Outdated
function (c::Bind)(args...)
c.f(interleave(c.a, args)...)
function (c::Bind)(args...; kw...)
c.f(interleave(c.a, args)...; c.k..., kw...)
end

"""
`bind(f, a, b)` is equivalent to Bind(f, (a, b))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you amend this docstring to include a keyword arg example?

src/Curry.jl Outdated
@@ -83,7 +84,8 @@ bind(f, args...) = Bind(f, args)
macro bind(ex)
ex.head == :call || error()
# `ex.args[1]` is the function and `ex.args[2:end]` are the positional arguments
return :(bind($(map(esc, ex.args)...)))
TODO_HANDLE_KW = ()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this serve the same purpose as a TODOcomment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sorry it is a leftover from some other thing I tried.

@goretkin
Copy link
Owner

Thanks for the interest and for the improvements!

@goretkin goretkin merged commit 4d9c9d9 into goretkin:master Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants