# \[1,2,3\] |\> f. doesn't work

**URL:** <https://discourse.julialang.org/t/1-2-3-f-doesnt-work/903>\
**Category:** General Usage\
**Tags:** question, proposal\
**Created:** [December 12, 2016, 10:08pm UTC](https://discourse.julialang.org/t/1-2-3-f-doesnt-work/903 "2016-12-12T22:08:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [December 12, 2016, 10:08pm UTC](https://discourse.julialang.org/t/1-2-3-f-doesnt-work/903/1 "2016-12-12T22:08:45Z")

</div>

Try this:

```julia
f(x) = x^2
[1,2,3] |> f.

```

with the dot, to map `f` over the array. It doesn’t work. Is this intended?

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [December 12, 2016, 10:15pm UTC](https://discourse.julialang.org/t/1-2-3-f-doesnt-work/903/2 "2016-12-12T22:15:40Z")

</div>

Just got an explanation for this. The `.` affects `.( )`, not `f`.  
Maybe one could define `.|>` for this usage? I think it would be convenient.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 12, 2016, 10:50pm UTC](https://discourse.julialang.org/t/1-2-3-f-doesnt-work/903/3 "2016-12-12T22:50:48Z")

</div>

`f.(args...)` is equivalent to `broadcast(f, args...)`, but `f.` by itself does not define a function. (Think of the `.` as modifying the function call operation `(...)` and not `f`.)

It should indeed be possible to do `x .|> f` at some point (hopefully 0.6): this should be equivalent to `broadcast(|>, x, f)`, which should do what you want. Currently, my PR for dotted operations ([https://github.com/JuliaLang/julia/pull/17623](https://github.com/JuliaLang/julia/pull/17623)) doesn’t handle `|>`, but I should probably add this.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 12, 2016, 10:56pm UTC](https://discourse.julialang.org/t/1-2-3-f-doesnt-work/903/4 "2016-12-12T22:56:09Z")

</div>

Okay, I just added this to my #17623 PR; `[1,2,3] .|> (x->x+1)` now works. 😃

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [December 12, 2016, 10:57pm UTC](https://discourse.julialang.org/t/1-2-3-f-doesnt-work/903/5 "2016-12-12T22:57:48Z")

</div>

Great! Looking forward to 0.6.

Thanks.
