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

Add Apply and Traverse for SortedMap #1966

Closed
johnynek opened this issue Oct 12, 2017 · 7 comments · Fixed by #1972
Closed

Add Apply and Traverse for SortedMap #1966

johnynek opened this issue Oct 12, 2017 · 7 comments · Fixed by #1972
Assignees

Comments

@johnynek
Copy link
Contributor

see #1964 for more discussion.

@LukaJCB
Copy link
Member

LukaJCB commented Oct 13, 2017

Wouldn't we get conflicting instances because SortedMap is a subtype of Map?

@LukaJCB
Copy link
Member

LukaJCB commented Oct 15, 2017

So I tried this and it seemed to work just fine. Not sure why I thought it wouldn't work.

So I think we could get all the instances for SortedMap, that already exist for Map, but require an instance of Order[A] right?

Could potentially be relevant for #1831

@johnynek
Copy link
Contributor Author

Maybe we need to make it higher priority? Or maybe not. Subtyping and implicit resolution confuses me sometimes with what is and is not ambiguous.

@LukaJCB
Copy link
Member

LukaJCB commented Oct 15, 2017

We should probably also add instances for SortedSet while we're at it.

@johnynek
Copy link
Contributor Author

+1

@LukaJCB
Copy link
Member

LukaJCB commented Oct 15, 2017

Actually there can't be any instances for SortedSet, as that'd require an implicit Order [A] instance, when there is no actual A.

@kailuowang
Copy link
Contributor

When there are multiple instances for the target type F's inheritance hierarchy, (but not the type class), the instance for the subtype is more "specific" I think.

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

Successfully merging a pull request may close this issue.

4 participants