-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1 +/- ##
=======================================
Coverage 90.90% 90.90%
=======================================
Files 1 1
Lines 11 11
=======================================
Hits 10 10
Misses 1 1
Continue to review full report at Codecov.
|
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)) |
There was a problem hiding this comment.
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 = () |
There was a problem hiding this comment.
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 TODO
comment?
There was a problem hiding this comment.
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.
Thanks for the interest and for the improvements! |
I like the elegant implementation in your package a lot. Here is some better keyword support.