navigation

AvoidSinglePipeOperator (FL0077)

Introduced in 0.21.5

Cause

Use of the pipe operator when only one invocation is employed.

Rationale

When the use of the pipe operator happens for a single invocation (instead of a multiple one, which would add a chain of them, usually staggered across many lines), it doesn't aid readibility.

Example of single pipe operator usage:

let someFunc someParam =
    someParam
    |> someOtherFunc

Example of multiple pipe operator usage:

let someFunc someParam =
    someParam
    |> someOtherFunc
    |> yetAnotherFunc

How To Fix

Just use a normal function call, without the need for any operator:

let someFunc someParam =
    someOtherFunc someParam

Rule Settings

{
    "avoidSinglePipeOperator": { "enabled": false }
}