Skip to content
David Arno edited this page Feb 17, 2020 · 2 revisions

Pipe Operators

Basic parameter piping


Introduction to pipe operators

Consider the following sentence:

Pass the number, one, into function, f, then pass the result to function, g.

Normally, in C#, we must write this back to front, in the following form:

g(f(1));

The idea of the forward pipe operator, is that it allows the above to be written in code in the same way that it would be expressed in English. Using F# notation, this would be:

1 |> f |> g

C# doesn't support defining new operators, so Succinc<T> implements this with the Into extension method, in SuccincT.Functional.PipeExtensions. So the above code can now be written as:

1.Into(f).Into(g);