Like you've correctly identified, >> is the composition operator. If you have two functions:
f:A->Bg:B->C
Then f >> g is a new function from A to C. Concretely:
leth=f>>gh(x)=g(f(x))
The pipe operator is just a way to reverse function invocation. Concretely:
f(x)=x|>f
It allows you to write the argument before the function. You'll find this useful in many situations.
In general, the pipe operator is used everywhere (that's where F# gets its logo!); the composition operator sees more limited use. See docs.microsoft.com/en-us/dotnet/fs... - implicit arguments don't play well with tooling, so they are a tool to use sparingly.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Like you've correctly identified,
>>
is the composition operator. If you have two functions:Then
f >> g
is a new function from A to C. Concretely:The pipe operator is just a way to reverse function invocation. Concretely:
It allows you to write the argument before the function. You'll find this useful in many situations.
In general, the pipe operator is used everywhere (that's where F# gets its logo!); the composition operator sees more limited use. See docs.microsoft.com/en-us/dotnet/fs... - implicit arguments don't play well with tooling, so they are a tool to use sparingly.