Skip to content
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

Drop covariance? #1

Open
snowleopard opened this issue Nov 23, 2017 · 2 comments
Open

Drop covariance? #1

snowleopard opened this issue Nov 23, 2017 · 2 comments

Comments

@snowleopard
Copy link
Contributor

snowleopard commented Nov 23, 2017

As pointed by @mechkg, we can drop covariance and obtain a more type-safe interface as a result.

Do we want to keep covariance? I'm tempted to drop it both for the sake of simplification and for better type safety of the graph transformation interface.

As a comparison, List is covariant, whereas Set is not.

@adithyaselv
Copy link

It is an very interesting design choice to discuss upon and decide. I find no compelling reason for graph to be invariant although as you mentioned it can be done for simplification. Here Daniel's answer gives idea why set is invariant and this thread gives more insights about the design decision.

@snowleopard
Copy link
Contributor Author

@adithyaselv Thanks! Yes, after reading various discussions, including the ones you link, I guess we can live with slightly less elegant code for the sake of having covariance, which seems to be expected by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants