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.

Feature request: Reverse pipe operator intention

See original GitHub issue

Sometimes I have code that looks like this foo <| bar <| 5 and I would like to reverse it so it looks like this 5 |> bar |> foo. Doing this by hand is time consuming and it would be nice if there was an intention that does this automatically (this also includes support for reversing >>/<<)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
klazukacommented, Sep 5, 2019

I’m reluctant to duplicate that work. Needs investigation.

0reactions
dillonkearnscommented, Sep 14, 2020

It would also be useful to have an intention that turns >> chains into |> (or << to <|).

Separate, but related topic. It’s a fairly simple transformation:

List.map (.user >> .id)

Turns into

List.map (\value -> value |> .user |> .id)

And then that brings up another possible Intention, which is to turn chains of dot-accessors into directly access, like this:

List.map (\value -> value.user.id)
Read more comments on GitHub >

github_iconTop Results From Across the Web

causes weird error (was: Is the reverse pipe operator a real ...
I'm assuming fish is trying to open an actual file called | which results in the error above. The text was updated successfully,...
Read more >
Elixir Exploration - Pipe Operator - Fn/Log
Since the operator is a macro, it allows us to omit the first argument of each function and assume the results are passed...
Read more >
A pipeline-rewrite operator - open-std.org
The goal of the “pipeline-rewrite” operator proposed herein is to solve all of the above issues, as well as generalize the concept of...
Read more >
Backpipe Operations
The backpipe package provides a single 'backpipe" operator ( %<% ) that allows the order of operands in a pipe statuement to be...
Read more >
HTTP/1.1: Connections
HTTP requests and responses can be pipelined on a connection. ... Clients using future versions of HTTP might optimistically try a new feature, ......
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