[Haskell-cafe] Re: PrefixMap is a Trie

Christian Maeder maeder at tzi.de
Tue Feb 28 08:33:30 EST 2006


David F.Place wrote:
> The PrefixMap datastructure implements a Prefix Tree which allows a
> key/value relationship.
> 
> \begin{code}
> 
> data PrefixMap k v = Node (Maybe v) (Map.Map k (PrefixMap k v))
>                      deriving (Show)
> \end{code}

You may compare your code with Keith's implemenation of a Trie.
http://article.gmane.org/gmane.comp.lang.haskell.libraries/2571

Find attached a modified version (that I never tested, though).

Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Trie.hs
Type: text/x-haskell
Size: 4222 bytes
Desc: not available
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20060228/ce073614/Trie.bin


More information about the Haskell-Cafe mailing list