
Is there an efficient way to make simple databases in Haskell? I
something like a dictionary, hash table or associative container of some kind.
I'm aware that Haskell being pure functional means that those
mean things
are not as easily implemented as they can be in other languages, in fact, I've implemented a simple one myself, using a list of pairs (key,value) (which means it's slow on lookup) and an optional monad to handle the updates/lookups.
I guess what I'm wondering is what has been done in this respect. There is no such thing in the standard library, as far as I can see, and my search through the web has turned up nothing.
Chris Okasaki has developed a whole mess of purely function data structures. He has a book: http://www.cs.columbia.edu/~cdo/papers.html#cup98 Maybe this is what you're looking for? HTH -Justin

At 12:12 AM 5/15/2001 -0400, Justin: Member Since 1923 wrote:
something like a dictionary, hash table or associative container of some kind.
Chris Okasaki has developed a whole mess of purely function data structures. He has a book: http://www.cs.columbia.edu/~cdo/papers.html#cup98
Maybe this is what you're looking for?
I believe so! Thanx! Geee... A red-black tree set in 30 lines of code... I hope it works :) I've never done one of those myself, but it's said that they are as tricky as they are efficient... What I'd use in C++ (STL map) is something pretty close, and it's usually implemented as a R/B tree, so I think it'll work. Salutaciones, JCAB --------------------------------------------------------------------- Juan Carlos "JCAB" Arevalo Baeza | http://www.roningames.com Senior Technology programmer | mailto:jcab@roningames.com Ronin Entertainment | ICQ: 10913692 (my opinions are only mine) JCAB's Rumblings: http://www.metro.net/jcab/Rumblings/html/index.html
participants (2)
-
Juan Carlos Arevalo Baeza
-
Justin: Member Since 1923