Two Unique Ways of Piping data in Elixir

Dreaming in pipe |>

No junk, straight to code

Assume data = {:ok, [1,2,3,4,5]} and we need to pass the data to the next function. 
Do we need to write another function to do that job for this small operation? I don’t think so.

Check this…

TYPE –1 🎉

data
|> (fn {:ok, list} -> list end).()
|> length()
5

TYPE — 2 🎉

Here, instead of sending the length itself, I would like to send a message something looks like Total Images : 5 Do I again need to use inline function fn again here? I don’t think so.

Check this…

data
|> (& {:ok, list} -> list ).()
|> length()
|> (&"Total Images : #{&1}").()

Hope you like them. Thanks for reading…

Join Our Telegram Channel

https://t.me/blackoders
if worth_clapping, do: “clap”, else: nil

Happy Coding !

Thanks Giving
Hey guys thanks for the support you have shown in reading and clapping the previous parts of this category.

to be continued … in 10 Killer Elixir Tips Part 9( Coming Soon…)

Thanks 4 UR Time.. Read all parts of Killer Elixir Tips and download README.MD file at GitHub .
 Click on link All Killer Elixir Parts. Contribute with a ★ 🍏

🙏 🙏 GRATITUDE 🙏 🙏