-
Notifications
You must be signed in to change notification settings - Fork 5
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
[REFACTOR] Maybe change the implementation syntax? #7
Comments
Actually I guess it should be defimpl_ex Blah, for: i when is_integer(i), as: Integer do
Because in Elixir you do I would not use this: defimpl_ex Blah.Integer, for: i when is_integer(i) do
Because how can we be sure what is the protocol and what is the sub-namespace module when reading |
Isn't that the same as Elixir? The first argument is the protocol, the second is what you are implementing the protocol for? |
Well I may have misunderstood your first post. I thought that |
When you wrote defimplEx Integer, i when is_integer(i), for: Blah do
To me it looks like |
Currently an implementation head is something like:
Since the name is put as a sub-namespace of the main protocol anyway, probably just simplify it to:
The text was updated successfully, but these errors were encountered: