MemoTrie
MemoTrie copied to clipboard
Making it work with Enum?
Hey,
it would be nice if MemoTrie could handle Enum
s.
An instance Enum a => HasTrie a
would probably be overlapping, but maybe a newtype or custom function can make it convenient enough.
Thanks for the suggestion. Any thoughts on how to define such an instance?
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)