Is it OK to rely on returned data during series of pipes?

@BitGonzo: Depends on scenarios. Some time you can’t simply trust data passed in pipe. A good example here are web scrapers where some data part of structs can simply not exists, because they have been not specified in system.

To handle such cases you can use an OK library for that. Here is an documentation of lhs ~> rhs operator:

Pipeline version of map/2.

Examples
iex> {:ok, 5} ~> Integer.to_string
{:ok, "5"}

iex> {:error, :zero_division_error} ~> Integer.to_string
{:error, :zero_division_error}

iex> {:ok, "a,b"} ~> String.split(",")
{:ok, ["a", "b"]}