[API Design] Callable objects with side effect in Julia

In a recent package we developed (https://github.com/QuantumBFS/Yao.jl) we represent quantum circuit as a tree (just think about operators compiled as a tree), which is called block in the packages.

It looks natural and convenient to use pipeline |> to compose (chain) a circuit with blocks, however, the blocks have side effect on registers, which you will not notice with |>.

So the problem is: Should we use/overload |> for callable types that has side effect? Or we should delete it at all. Since you cannot always name the instance with a ! (which can be dangerous).

We had a quite long discussion around that, but still have no idea if there is a better way with this API. A related issue: Remove `with` and pip interface for blocks · Issue #113 · QuantumBFS/Yao.jl · GitHub