You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from #8 and #9, we have basic support for union type and pattern match, like following:
@specexample({:a,t1}|{:b,t2}|{:c,t3})::anydefexample({:a,x})do# ex type should be able to know that `x` is t1 typeenddefexample({:b,x})do# ex type should be able to know that `x` is t2 typeenddefexample({:c,x})do# ex type should be able to know that `x` is t3 typeend
it could be nice if we can have more advanced support like following:
@specexample({:a,t1}|{:b,t2}|{:c,t3})::anydefexample({:a,x})do# ex type should be able to know that `x` is t1 typeenddefexample({:b,x})do# ex type should be able to know that `x` is t2 typeenddefexample(y)do# ex type should be able to know that `y` is `{:c, t3}` typeend
also, similarly, for case special form:
# when x is type `{:ok, integer} | {:error, String.t()} | :error`casexdo{:ok,y}-># ex type should be able to figure out that `y` is `integer` typee-># ex type should be able to figure out that `e` is `{:error, String.t()} | :error` typeend
This advanced support should cover
multi clauses functions
case special form
anonymous function
The text was updated successfully, but these errors were encountered:
from #8 and #9, we have basic support for union type and pattern match, like following:
it could be nice if we can have more advanced support like following:
also, similarly, for case special form:
This advanced support should cover
The text was updated successfully, but these errors were encountered: