You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.
The |> function is used to pipe data through a number of functions, like so:
(|>100
range
(curry filter math:even?)) => a list of all the even nummbers from 0 to 100; It also accepts functions
(|> (lambda () (++"Hello guys!"))
string:upper-case
(curry take 5)) ; => "HELLO"
While this is certainly very useful, having to curry each function quickly becomes tedious. I propose a change to the function to allow for automatic currying. This would change the above snippets to:
(|>100
range
(filter math:even?)) => a list of all the even nummbers from 0 to 100; It also accepts functions
(|> (lambda () (++"Hello guys!"))
string:upper-case
(take5)) ; => "HELLO"
The impact is limited. The function probably has to be rewritten to a macro, but it should be trivial to make this feature backwards compatible, since (curry fun) == (curry (curry fun)), so double currying is fine.
Cheers!
The text was updated successfully, but these errors were encountered:
The
|>
function is used to pipe data through a number of functions, like so:While this is certainly very useful, having to curry each function quickly becomes tedious. I propose a change to the function to allow for automatic currying. This would change the above snippets to:
The impact is limited. The function probably has to be rewritten to a macro, but it should be trivial to make this feature backwards compatible, since
(curry fun) == (curry (curry fun))
, so double currying is fine.Cheers!
The text was updated successfully, but these errors were encountered: