# What does \`|\>\` mean?

**URL:** <https://discourse.julialang.org/t/what-does-mean/42880>\
**Category:** General Usage\
**Created:** [July 10, 2020, 11:18pm UTC](https://discourse.julialang.org/t/what-does-mean/42880 "2020-07-10T23:18:12Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gus\_Hart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gus_hart/32/6987_2.png) [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Post date:** [July 10, 2020, 11:18pm UTC](https://discourse.julialang.org/t/what-does-mean/42880/1 "2020-07-10T23:18:12Z")

</div>

I saw this syntax during a Juliacon2018 video that I was watching. It was unfamiliar to me, so I tried to find it in the documentation, but the search functionality didn’t send me anywhere useful. I scrolled through different parts of the documentation that seemed relevant but it never turned up.

I’m sure this is something banal, but I’m curious

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [July 10, 2020, 11:18pm UTC](https://discourse.julialang.org/t/what-does-mean/42880/2 "2020-07-10T23:18:54Z")

</div>

[https://docs.julialang.org/en/v1/manual/functions/#Function-composition-and-piping-1](https://docs.julialang.org/en/v1/manual/functions/#Function-composition-and-piping-1)

---

<div class="post-metadata">

**Author:** ![Gus\_Hart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gus_hart/32/6987_2.png) [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Post date:** [July 10, 2020, 11:21pm UTC](https://discourse.julialang.org/t/what-does-mean/42880/3 "2020-07-10T23:21:28Z")

</div>

Thanks. I just also tried `?|>` at the REPL and that started me on a useful path too.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [July 10, 2020, 11:41pm UTC](https://discourse.julialang.org/t/what-does-mean/42880/4 "2020-07-10T23:41:58Z")

</div>

Note also that there is a package, [Pipe.jl](https://github.com/oxinabox/Pipe.jl), that greatly improve the pipe operator in base…

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [July 11, 2020, 2:10am UTC](https://discourse.julialang.org/t/what-does-mean/42880/5 "2020-07-11T02:10:40Z")

</div>

It’s another of writing function call.

E.g let `fn` be a function then

`x |> fn` is equivalent to `fn(x)`

Let `fn2` be another function then

`x |> fn |> fn2` is equivalent to `fn2(fn(x))` and is also equivalent to `fn2(x | fn)` and `fn(x) |> fn2`. You get the point.

You can also use the `.` broadcasting syntax with it. E.g

`fn.(x)` is equivalent to `x .|> fn`

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [July 11, 2020, 3:04am UTC](https://discourse.julialang.org/t/what-does-mean/42880/6 "2020-07-11T03:04:01Z")

</div>

```julia
julia> MulByTwo(x) = 2 * x
MulByTwo (generic function with 1 method)

julia> MulBySeven(x) = 7 * x
MulBySeven (generic function with 1 method)

julia> 10.0 |> MulByTwo |> MulBySeven
140.0

```

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [July 11, 2020, 3:42am UTC](https://discourse.julialang.org/t/what-does-mean/42880/7 "2020-07-11T03:42:12Z")

</div>

Or

```julia
julia> mul(n) = x -> x * n
mul (generic function with 1 method)

julia> 10.0 |> mul(2) |> mul(7)
140.0

```

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [July 11, 2020, 10:15am UTC](https://discourse.julialang.org/t/what-does-mean/42880/8 "2020-07-11T10:15:54Z")

</div>

> [@xiaodai](#):
>
> `fn.(x)` is equivalent to `x .|> fn`

This is not quite true, since the latter can also iterate over `fn`, which is sometimes useful. For example, the following works, because it iterates over `(cos, sin)` and broadcast grows compatible dimensions:

```julia
julia> [0 pi/3 pi/4 2pi/3 pi/2] .|> (cos, sin)
2×5 Array{Float64,2}:
 1.0 0.5 0.707107 -0.5 6.12323e-17
 0.0 0.866025 0.707107 0.866025 1.0

```

This would not work with the standard `fn.(x)` syntax.

---

<div class="post-metadata">

**Author:** ![austinbean](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@austinbean](https://discourse.julialang.org/u/austinbean)\
**Post date:** [July 11, 2020, 5:50pm UTC](https://discourse.julialang.org/t/what-does-mean/42880/9 "2020-07-11T17:50:27Z")

</div>

I don’t know the best way to solve this problem, but I want to second the comment that it can be hard to find the meaning of punctuation in the docs.

When I was a beginner, it took me a while to track down what `<:` and `::` meant (for example) b/c it was hard to search for those symbols in the docs.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 11, 2020, 5:57pm UTC](https://discourse.julialang.org/t/what-does-mean/42880/10 "2020-07-11T17:57:06Z")

</div>

> [@austinbean](#):
>
> it can be hard to find the meaning of punctuation in the docs

[https://docs.julialang.org/en/v1/base/punctuation/](https://docs.julialang.org/en/v1/base/punctuation/)

---

<div class="post-metadata">

**Author:** ![austinbean](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@austinbean](https://discourse.julialang.org/u/austinbean)\
**Post date:** [July 11, 2020, 6:42pm UTC](https://discourse.julialang.org/t/what-does-mean/42880/11 "2020-07-11T18:42:14Z")

</div>

Amazing. Thanks! If that was around in 2016, I did not know about it when I needed it. It would be cool if that popped up if you searched for `::` in the search function on the docs website. Like Microsoft Clippy saying “it looks like you’re searching for some Julia-specific punctuation”

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 12, 2020, 6:40am UTC](https://discourse.julialang.org/t/what-does-mean/42880/12 "2020-07-12T06:40:59Z")

</div>

Yes, it is hard to search for punctuation at the moment in the generated docs. You may want to open an issue about this, I could not find an existing on (but please check).

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [July 12, 2020, 11:59am UTC](https://discourse.julialang.org/t/what-does-mean/42880/13 "2020-07-12T11:59:29Z")

</div>

> [@Tamas\_Papp](#):
>
> You may want to open an issue about this, I could not find an existing on (but please check).

Possibly related to [this one](https://github.com/JuliaDocs/Documenter.jl/issues/615)
