|>(_:_:)

public func |> <A, B>(lhs: A, rhs: (A) -> B) -> B

Application operator. This operator is redundant, since ordinary application f(x) means the same as x |> f. However, |> has low, left-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:

h(x) |> g |> f = f(g(h(x)))

It is also useful in higher-order situations, such as zipWith(|>, fs, xs).

  • A

    Declaration

    Swift

    public func |> <A, B>(lhs: A, rhs: (A) -> B) -> B