HaloO Autrijus, you wrote:
D) Make the return type observe both #2 and #3 at compile time, using type variables:sub id ( (::T) $x ) returns ::T { return($x) }And this is a natural extension to guide the inferencer so it won't be totally giving up on polymorphic functions such as &id. C) and D) can be taken together, resulting to a powerful soft typed language.
This is my preference. The only known issue with parametric typing is the proliferation of params as soon as you want to stay away from unpecificity.
However, if we take the view that type annotation are merely storage allocation hints and runtime coercers, then A) is probably the way to go.
Please no. Or at least not exclusively. I see your "storage allocation hints" as a data environment needed to implement the type. -- $TSa.greeting := "HaloO"; # mind the echo!
