O'Reilly logo

Functional Web Development with Elixir, OTP, and Phoenix by Lance Halvorsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transforming Data

Applications need to actually do things to be useful. The essence of creating that behavior in functional programming is transforming data. This whole next section will be about just that—defining functions that transform the data structures we’ve defined.

Elixir gives us the pipeline operator |>, which allows us to elegantly take the output of a function and give it to another function as its first argument. It’s tailor-made for the kind of work we’ll be doing, and it’s very idiomatic in Elixir.

We can think of pipelines as chaining functions together vertically. We can also chain them horizontally—functions calling functions either in the same module or across modules.

We’ll use both approaches to take complex work, break ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required