We know that Elixir programming is about transforming state, and |> operator plays the starring role in making that happen. But sometimes you can’t just chain two named functions together—the output of one doesn’t match the first parameter of the next. Until I discovered this trick, I had to break the pipeline and assert the interim result to a local variable, or write a private function that massaged the value into the right format.

This video shows you some ways of overcoming this. It’s probably not new, but I haven’t seen the technique in code that I’ve read.

Please keep it clean, respectful, and relevant. I reserve the right to remove comments I don't feel belong.
  • NickName, E-Mail, and Website are optional. If you supply an e-mail, we'll notify you of activity on this thread.
  • You can use Markdown in your comment (and preview it using the magnifying glass icon in the bottom toolbar).