This question already has answers here:
Closed 6 years ago.
Ruby has a method that allows us to observe a pipeline of values, without modifying the underlying value:
# Ruby
list.tap{|o| p o}.map{|o| 2*o}.tap{|o| p o}
Is there such a method in Scala? I believe this is called a Kestrel Combinator, but can't be sure.