# Funny pipe code

**URL:** <https://forum.elixirforum.com/t/funny-pipe-code/17964>\
**Category:** Questions\
**Tags:** learning-elixir, pipe-operator\
**Created:** [November 16, 2018, 11:13am UTC](https://forum.elixirforum.com/t/funny-pipe-code/17964 "2018-11-16T11:13:12Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [November 16, 2018, 1:45pm UTC](https://forum.elixirforum.com/t/funny-pipe-code/17964/10 "2018-11-16T13:45:43Z")

</div>

```Elixir
def f_1(data) do
  data
  |> transformation_1()
  |> transformation_2()
  |> f_2()
end

# still purely sequential - more like a (sequential) fork/join
# because everything has to be an expression.
#
def f_2(snapshot_data) do
  {transformation_3(snapshot_data),transformation_4(snapshot_data)} # return both results as a tuple
end

```

[![functional-programming-patterns-ndc-london-2014-15-638](https://forum.elixirforum.com/uploads/default/original/2X/8/8a19e007a96f40cdb79872e3252d81fe869c7f97.jpeg) ](https://fsharpforfunandprofit.com/fppatterns/)

More often than not the solution to a problem is “functions”.

[![pie](https://forum.elixirforum.com/uploads/default/original/2X/2/23dc635cd16a5db68f5fb089f9493b6c0d2c2102.png) ](https://youtu.be/0if71HOyVjY?t=2417)

---

_[View the full topic](https://forum.elixirforum.com/t/funny-pipe-code/17964)._
