Hello Nikita, On Thu, Oct 04, 2018 at 02:50:09AM +0300, Никита Фуфаев wrote: > As this problem requires type to depend on runtime value, > you need singletons. Many thanks for showing us the way, very elegant solution.