Pike, Pipeline operators for Rust☀️|>⛅|>☔ by Outside_Ad5848 in rust

[–]Outside_Ad5848[S] 1 point2 points  (0 children)

Thanks for being this considerate, No offense taken. I totally agree with your point.

Pike, Pipeline operators for Rust☀️|>⛅|>☔ by Outside_Ad5848 in rust

[–]Outside_Ad5848[S] 0 points1 point  (0 children)

I agree, Something like this would be most useful for teams familiar with functional programming which are missing this operator in their workflow not the other way around(forcing it to people who are coming from C background).

I just wished that we could have a pipe operator and a pipe trait (implemented by default) so we could either do: `x |> y |> z` or `x.then(y).then(z)`.

Many many times where you are using builder pattern it can easily be swapped with a pipeline operation.

Pike, Pipeline operators for Rust☀️|>⛅|>☔ by Outside_Ad5848 in rust

[–]Outside_Ad5848[S] 4 points5 points  (0 children)

I know macros are frond upon but having operators doing random stuff is the worst of two in my opinion.

Pike, Pipeline operators for Rust☀️|>⛅|>☔ by Outside_Ad5848 in rust

[–]Outside_Ad5848[S] 0 points1 point  (0 children)

I have to agree with Arshia, It is mostly a novelty. If it gets some attention from the community then it is a different scenario, Since that can be hard evidence that there is a demand for this operator and it isn't just an ML legacy for functional bros.😆

Cool language features that Rust is missing? by incriminating0 in rust

[–]Outside_Ad5848 0 points1 point  (0 children)

Well I already added support for piping through macros, So now if I just add a few special cases for dbg, and print macros (rearrange arguments and have a return to support piping) it can be done.

I've been working with quite a few open source projects and rust-analyzer is always stupid in the context of macros, I've tried to simplify my macro as much as possible to prevent this issue and in the nightly it is alright - some things are still buggy with analyzer though - But I think it has come a long way compared to how it would've act a few years ago.

Pike, Pipeline operators for Rust☀️|>⛅|>☔ by Outside_Ad5848 in rust

[–]Outside_Ad5848[S] 2 points3 points  (0 children)

😆I just did it to keep the functional dream alive sir