-
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
A way to allow for filter
, map
piping...
#1
Comments
Also, if you like this idea, I'm happy to make a PR for this package to add the feature. |
Thanks! I know too little of other packages for this stuff so it's nice to see LambdaFn.
I do agree this is a tricky problem. The issue I see with this is that it amounts to a lot of guessing about the user's intentions which I think leads to something less general purpose. For example, we could no longer define I feel like the better solution here would be to be more explicit and allow @_ data |>
filter(_>10, __) |>
map(_+1, __) There may be other options, though. Overall my aim with this package is to make something which could possibly be included in |
Have a look at latest master; I implemented the BTW, I renamed the package to |
I like it! (Better than I like my own package
LambdaFn
). Thanks for putting this together!It occurred to me that, since this is a macro, you should be able to rewrite piping expressions to treat functions as if they have a curried version.
That is:
Could be re-written as:
The rule could be that if the top-level expression after
|>
is a function call, rewrite the expression to be a function that takes a single argument and passes it as the final argument of this top-level expression.Maybe that should be a separate macro (
@_>
@|>
,@|>_
??). It is essentially a combination of your macro@_
and the@>>
macro from Lazy.jl.The text was updated successfully, but these errors were encountered: