forked from rabbitmq/erlando
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
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
better interface for type instance pattern match #3
Comments
erlando_type error_m -erlando_type(error_m, [error_m/2]).
-export_type([error_m/2, ok/1, error/1]).
-type error_m(E, A) :: ok(A) | error(E).
-type ok(A) :: ok | {ok, A}.
-type error(E) :: {error, E}. convert to erl_types {c,union,
[{c,atom,[ok],unknown},
none,none,none,none,none,
{c,tuple_set,
[{2,
[{c,tuple,
[{c,atom,[error],unknown},any],
{2,{c,atom,[error],unknown}}},
{c,tuple,
[{c,atom,[ok],unknown},any],
{2,{c,atom,[ok],unknown}}}]}],
unknown},
none,none,none],
unknown} generates pattern type({ok, _}) ->
error_m;
type({error, _}) ->
error_m;
type(ok) ->
error_m erlando_type state_t -erlando_type({state_t, [state_t/3]}).
-export_type([state_t/3]).
-type state_t(S, M, A) :: {state_t, inner_t(S, M, A)}.
-type inner_t(S, M, A) :: fun((S) -> monad:m(M, {A, S})). converted to erl_types {c,tuple,
[{c,atom,[state_t],unknown},
{c,function,
[{c,product,[{c,var,'S',unknown}],unknown},any],
unknown}],
{2,{c,atom,[state_t],unknown}}} generates pattern type({state_t, Args1}) when is_function(Args1) ->
state_t |
move to branch type_by_erlang |
support R19 by moving dialyzer_utils.erl and erl_types.erl to this project from erlang otp R20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
current type pattern match interface is
will be convert to such pattern match in typeclass module
so these features are not supported
there should have a better interface for type instance pattern match
The text was updated successfully, but these errors were encountered: