34 ms·
I'm not sure I understand how static types and existing Erlang OTP patterns are supposed to work together. What is the type of a gen_server? It can literally
by platz 10y ago
I'm not sure I understand how static types and existing Erlang OTP patterns are supposed to work together.
What is the type of a gen_server? It can literally become anything.
What is is the type of become messages?
http://joearms.github.io/2013/11/21/My-favorite-erlang-program.html http://joearms.github.io/2013/11/21/My-favorite-erlang-progr...
- wcummings 10y agoYou can do success type-checking w/ dialyzer, so there's already a way to think about this. An instance of a gen_server is a pid, the become message in this example is a tuple of an atom and function. http://erlang.org/doc/reference_manual/typespec.html http://erlang.org/doc/reference_manual/typespec.html
- platz 10y agoof course, but I wouldn't assume success typing (dialyzer) is compatible with static parametric typing, ala purescript
- im_down_w_otp 10y agoI'm not sure I'm seeing the gap. You get parametric types with Dialyzer + type specs. There are also several flags you can enable for Dialyzer to make its checking more strict and exhaustive. Now that the escape hatch from type safety, that was impossible to avoid using Maps, has been mostly closed (and you're under no obligation to use Maps to begin with) it's not at all clear to me what you wouldn't be able to do.