<p dir="auto">Would it be possible to allow calling any function on Any so that the value is passed to the function as the first parameter and the parameters passed to the function call on the value is added afterwards?<br>
ex.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sum(a::Int, b::Int) -&gt; a + b

a = 1
sum(1, 2) # = 3
a.sum(2) # = 3 or
1.sum(2) # = 3"><pre class="notranslate"><code class="notranslate">sum(a::Int, b::Int) -&gt; a + b

a = 1
sum(1, 2) # = 3
a.sum(2) # = 3 or
1.sum(2) # = 3
</code></pre></div>
<p dir="auto">Is it possible to indicate in a deterministic way what a function will return in order to avoid run time exceptions?</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  | | |_| | | | (_| |  |  Version 1.6.0-DEV.1653 (2020-12-04)
 _/ |\__'_|_|_|\__'_|  |  Commit 0db72ee7d2* (1 day old master)
|__/                   |

julia&gt; MyType{K, T} = Set{T}
Set"><pre class="notranslate">  <span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span>_<span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span> <span class="pl-k">|</span> (_<span class="pl-k">|</span> <span class="pl-k">|</span>  <span class="pl-k">|</span>  Version <span class="pl-c1">1.6</span>.<span class="pl-c1">0</span><span class="pl-k">-</span>DEV.<span class="pl-c1">1653</span> (<span class="pl-c1">2020</span><span class="pl-k">-</span><span class="pl-c1">12</span><span class="pl-k">-</span><span class="pl-c1">04</span>)
 _<span class="pl-k">/</span> <span class="pl-k">|</span><span class="pl-k">\</span>__<span class="pl-k">'</span>_<span class="pl-k">|</span>_<span class="pl-k">|</span>_<span class="pl-k">|</span><span class="pl-k">\</span>__<span class="pl-k">'</span>_<span class="pl-k">|</span>  <span class="pl-k">|</span>  Commit <span class="pl-c1">0</span>db72ee7d2<span class="pl-k">*</span> (<span class="pl-c1">1</span> day old master)
<span class="pl-k">|</span>__<span class="pl-k">/</span>                   <span class="pl-k">|</span>

julia<span class="pl-k">&gt;</span> MyType{K, T} <span class="pl-k">=</span> Set{T}
Set</pre></div>
<p dir="auto">Not mentioned in <a href="https://docs.julialang.org/en/v1/manual/types/#UnionAll-Types" rel="nofollow">https://docs.julialang.org/en/v1/manual/types/#UnionAll-Types</a></p>
<p dir="auto">Sorry in advance if this is a duplicate issue.</p>