Skip to content

[ refactor ] Data.AVL's map should be polymorphic #183

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

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

gallais
Copy link
Member

@gallais gallais commented Nov 23, 2017

This is a common pain-point as witnessed by the following SO
questions:

https://stackoverflow.com/questions/21369719/functor-instance-for-data-avl
https://stackoverflow.com/questions/47367747/data-avl-map-that-changes-value-type

This does not introduce anything new, it mostly splits up Data.AVL
into submodules Data.AVL.(Key|Height|Indexed) which are parameterised
by nothing more than what they need.

The type of map changes from (forall k. V k -> Vk) -> Tree -> Tree
to (forall k. V k -> W k) -> Tree V -> Tree W. We require 1 extra
type annotation in README.AVL

This is a common pain-point as witnessed by the following SO
questions:

https://stackoverflow.com/questions/21369719/functor-instance-for-data-avl
https://stackoverflow.com/questions/47367747/data-avl-map-that-changes-value-type

This does not introduce anything new, it mostly splits up Data.AVL
into submodules Data.AVL.(Key|Height|Indexed) which are parameterised
by nothing more than what they need.

The type of `map` changes from `(forall k. V k -> Vk) -> Tree -> Tree`
to `(forall k. V k -> W k) -> Tree V -> Tree W`. We require 1 extra
type annotation in README.AVL
@andreasabel
Copy link
Member

Great!
We are moving in the direction of having a usable interface for finite maps!

@MatthewDaggitt MatthewDaggitt merged commit f6ae4f7 into master Dec 1, 2017
@gallais gallais deleted the refactor-avl branch December 5, 2017 22:16
gallais added a commit that referenced this pull request Feb 20, 2018
This does not introduce anything new, it mostly splits up Data.AVL
into submodules Data.AVL.(Key|Height|Indexed) which are parameterised
by nothing more than what they need.
gallais added a commit that referenced this pull request Feb 23, 2018
This does not introduce anything new, it mostly splits up Data.AVL
into submodules Data.AVL.(Key|Height|Indexed) which are parameterised
by nothing more than what they need.
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 this pull request may close these issues.

3 participants