Not for me. I often temporarily define `tee/2` myself for debugging. Given this:
def tee(input, fun) do
fun.(input)
input
end
I can do a more targeted `IO.inspect`, looking only at the attribute(s) that I care about:
some_struct
|> some_operation()
|> tee(fn thing -> IO.inspect([thing.foo, thing.bar], label: "foo and bar after some_operation") end)
|> other_operation()
|> ....
Putting `IO.inspect` or `Stream.each(&IO.inspect/1)` or `debug_map` in the pipeline gives me a lot of irrelevant output. To see just what I want without `tee` requires breaking up the pipeline.
step1 =
some_struct
|> some_operation()
IO.inspect([step1.foo, step1.bar], label: "foo and bar after some_operation")
step1
|> tee(fn thing -> IO.inspect([thing.foo, thing.bar], label: "foo and bar after some_operation") end)
|> other_operation()
|> ....
It's precisely because I want a targeted inspection that plays nicely with pipelines that I define `tee` for myself.