glguy / tries

BSD 3-Clause "New" or "Revised" License
11 stars 8 forks source link

instance TrieKey (Natural, Word) #16

Closed strake closed 4 years ago

glguy commented 4 years ago

Would it be possible to have this not show a negative number?

*Data.GenericTrie> singleton (maxBound :: Word) 'a'
fromList [(-1,'a')]
strake commented 4 years ago

It would require a new type TrieRep Word. It should be easy to define a newtype of IntMap with Word keys and a saner Show instance; would it belong in this package, or a new dependency, or should i open a PR on containers?

I opened #17 for Natural only.

strake commented 4 years ago

@glguy I still need a Word instance. What option you prefer for where to define the Word-keyed map?

glguy commented 4 years ago

I closed the ticket via the commit that implemented that instance.

strake commented 4 years ago

Derp, thank you!