We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should already be able to do type hint with T.assert( expr :: type ). For example,
T.assert( expr :: type )
map = %{} # type is empty map T.assert(map :: %{optional(String.t) => integer}) # type is updated to %{optional(String.t) => integer} now.
if we support inline type hint like expr ~> type annotation. it may be easier (syntax sugar) to do type declaration, especially in pattern match.
expr ~> type
we can do
{first ~> integer(), second ~> String.t} = something_untyped
instead of
{first, second} = something_untyped T.assert first :: integer T.assert second :: String.t
^^ benefit is to avoid write first and second twice.
first
second
need to do some hacky thing to make it work. not sure if it worths the cost.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We should already be able to do type hint with
T.assert( expr :: type )
. For example,if we support inline type hint like
expr ~> type
annotation. it may be easier (syntax sugar) to do type declaration, especially in pattern match.we can do
instead of
^^ benefit is to avoid write
first
andsecond
twice.Implementation concern
need to do some hacky thing to make it work. not sure if it worths the cost.
The text was updated successfully, but these errors were encountered: