In my works I normally use
as a set forming operator. Its disadvantage, from my point of view, is that the vertical stroke is always the same, irrespective of the context. Is there any package that would make
\mid context sensitive? In the sense that when I for example use
the height of
\mid is adjusted to the height of the brackets? If not, could you please give me a hint how can I define it to work in this way?