[Haskell-cafe] implementing python-style dictionary in Haskell

David Menendez dave at zednenem.com
Tue Nov 18 16:54:18 EST 2008


On Tue, Nov 18, 2008 at 3:52 PM, Don Stewart <dons at galois.com> wrote:
> dave:
>> 2008/11/18 kenny lu <haskellmail at gmail.com>:
>> > The above number shows that my implementations of python style dictionary
>> > are space/time in-efficient as compared to python.
>> >
>> > Can some one point out what's wrong with my implementations?
>>
>> This isn't really a fair comparison. Map, IntMap, and Trie are
>> persistent data structures, and Python dictionaries are ephemeral.
>> (That is, when you "add" a key to a Map, you actually create a new one
>> that shares structure with the old one, and both can be used in
>> subsequent code. In Python, you would have to copy the dictionary.)
>>
>
> Strings, not ByteStrings. that's the difference.

Is that in response to what I wrote, or to the original question?

Speaking of ByteStrings and tries, has anyone implemented a Patricia
Trie for ByteStrings? I started putting one together a while back, but
I got distracted and never finished it.

-- 
Dave Menendez <dave at zednenem.com>
<http://www.eyrie.org/~zednenem/>


More information about the Haskell-Cafe mailing list