https://all-learning.com/scala-currying-and-automatic-type-dependent-closure-construction/