Execute pipes line by line in fsi
See original GitHub issueIs your feature request related to a problem? Please describe.
When writing pipelines in fsi, they have to be executed as a single unit:
1 values
2 |> fun1
3 |> fun2
You need to select lines 1 to 3 to execute it, but you cannot execute line 1, then 2, then 3.
Describe the solution you’d like
It would give more flexibility to execute lines one by one. When a line starts with |>, it would interpret it as
it |> fun1
Executing the previous script line by line would be interpreted as:
let it = values
let it = it |> fun1
let it = it |> fun2
Describe alternatives you’ve considered
Continue to select multiple lines, but it’s easy to forget and get an error at execution.
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
bash - Execute a command once per line of piped input?
The accepted answer has the right idea, but the key is to pass xargs the -n1 switch, which means "Use at most 1...
Read more >ANSYS 2020 Tutorial: 2-Way FSI of a Pipe Bend - YouTube
I will show you how to create the pipe bend geometry using SpaceClaim, ... If you need to make changes and run the...
Read more >How to use stdin pipe with fsharpi (fsi) and mono
actually i am not compiling fsharp code in order to execute it - the host process runs my own compiler (in fsi) for...
Read more >Pipe flow FSI using OpenFOAM and CalculiX
Hello, I want to perform 2D FSI simulation with Calculix, I saw the test case of the perpendicular flap where the mesh provided...
Read more >Working with pipes on the Linux command line
The pipe takes output from one command and uses it as input for another. And, you're not limited to a single piped command—you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, I think I understand the general idea. I doubt it is worth it though, but perhaps someone will want to take a stab at it.
My main concern is that this behavior would not always be desirable, and hence it will be tricky from UI perspective.
And on the other hand, it is fairly easy to achieve something like this already, by selecting only part of the pipeline expression to send to FSI (and taking advantage of the fact that alt+enter appends to whatever has already been typed in FSI, i.e. you can type
it
and then select|> fun2
in source and hit alt+enter, which will result in executingit |> fun2
).One concern I see with such feature (which could be handy) is that I’d expect it to work for multiline expression that start with the prefix operator, without having to define the selection properly:
To nail it perfectly is probably not as simple as it seems, and we end up still needing to rely on user being mindful with how the interpreter is used across several individual evaluations, it won’t change this fact drastically IMO.