for #{v}" # sideeffect for demonstration {:ok, v + 1} end def error_fn(_) do {:error, "I'm a bad fn!"} end def raising_fn(_) do raise "I'm raising!" end def result do 1 |> tagged_inc >>> tagged_inc >>> tagged_inc end def error_result do 1 |> tagged_inc >>> tagged_inc >>> error_fn >>> tagged_inc end def raising_result do 1 |> tagged_inc >>> tagged_inc >>> raising_fn >>> tagged_inc end end iex> TripleArrowExample.result inc for 1 inc for 2 inc for 3 {:ok, 4}
do Map.put(acc, :first_fn_passed, true) end end defmodule Plugin2 do use Plugin.Builder plugin :second_fn def second_fn(acc, _) do Map.put(acc, :second_fn_passed, true) end end defmodule Plugin3 do use Plugin.Builder plugin Plugin1 plugin Plugin2 end acc = Plugin.call(Plugin3, %{}) true = Map.get(acc, :first_fn_passed) true = Map.get(acc, :second_fn_passed)
on his way home. Talking with him made me realize how much of what I do flies in the face of what I liked, what I started programming for. Each of the people Printf met are roles I see myself taking one day or another over time. I was encouraged by them to become them, and probably encouraged people to do the same. Where I got dragged in the game of trying to become a real programmer, Printf didn't. He said he was okay with not being a real programmer, that he preferred to be a programmer with a human face.