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

Making it work with Enum? #1

Open
nh2 opened this issue Nov 25, 2013 · 2 comments
Open

Making it work with Enum? #1

nh2 opened this issue Nov 25, 2013 · 2 comments

Comments

@nh2
Copy link

nh2 commented Nov 25, 2013

Hey,

it would be nice if MemoTrie could handle Enums.

An instance Enum a => HasTrie a would probably be overlapping, but maybe a newtype or custom function can make it convenient enough.

@conal
Copy link
Owner

conal commented Nov 25, 2013

Thanks for the suggestion. Any thoughts on how to define such an instance?

@glguy
Copy link

glguy commented Nov 26, 2016

It might be nice to approach this in the same way you approach using GHC.Generics to implement instances. Some definitions for trieEnum, untrieEnum, and enumerateEnum could be provided. Instances would then use newtype a :-> b = SomeTrie (Int :-> b)

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

3 participants