question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add implicit partially applied operator function syntax

See original GitHub issue
(< 5) => (lambda x: x < 5)
(5 +) => (lambda x: 5 + x)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:26 (16 by maintainers)

github_iconTop GitHub Comments

3reactions
vindarelcommented, Jun 24, 2016

I like very much the (-> ? + 2) suggestion 😃 (more consistent than $ imo)

But why is ( < 2) , your first suggestion, eliminated ? That’s very elegant, the shortest (and what I’m used to with livescript’s functional library). Chaining transformations like that is a joy, there’s nothing redundant, what’s in there matters:

[ { id: 1, title: ""}... ]
|> filter(.id > 3)  
|> sort-by(.title)  

instead of

[ {...}]
|> filter( -> ?.id > 3) # or ?['id']
|> sort-by( -> ?.title)

which is pretty good also 😃

1reaction
evhubcommented, Jul 7, 2016

@vindarel Thanks for the input! I think I’m currently leaning towards 1, and that will probably be what gets implemented in the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2.3.5. Partial Application · Functional Programming in OCaml
Partial application. We could define an addition function as follows: let add x y = x + y. Here's a rather similar function:...
Read more >
OCaml for the Skeptical: Defining and Applying Functions
This is why OCaml only needs functions of one argument. OCaml doesn't work this way just to be perverse; it does it because...
Read more >
Partial function application - Rosetta Code
Partial function application is the ability to take a function of many parameters and apply arguments to some of the parameters to create...
Read more >
How to create and use partial functions in Scala
A partial function is a function that does not provide an answer for every possible input value it can be given. It provides...
Read more >
Functions - F# | Microsoft Learn
In this article. Syntax; Remarks; Scope; Function Bodies; Return Values; Calling a Function; Partial Application of Arguments; Recursive ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found