Hi,all I'm a new one in this Haskell programming language. I have a program which involved a lot of computation tasks and it's quite inefficient,so I'm currently examing the possibility of using hash table in my data structure, can some one tell me how to implement it? I can't find much information about it. Thanks a lot Rui ---------------------------------------- This mail sent through www.mywaterloo.ca
r2yang@engmail.uwaterloo.ca wrote:
Hi,all
I'm a new one in this Haskell programming language. I have a program which involved a lot of computation tasks and it's quite inefficient,so I'm currently examing the possibility of using hash table in my data structure, can some one tell me how to implement it? I can't find much information about it.
Thanks a lot
Rui
http://www.haskell.org/ghc/docs/6.0/html/base/Data.HashTable.html Google[1] is your friend. HTH, --ag [1] Or your favorite search engine. -- Artie Gold -- Austin, Texas Oh, for the good old days of regular old SPAM.
Am Mittwoch, 8. Oktober 2003, 04:42 schrieb Artie Gold:
r2yang@engmail.uwaterloo.ca wrote:
Hi,all
I'm a new one in this Haskell programming language. I have a program which involved a lot of computation tasks and it's quite inefficient,so I'm currently examing the possibility of using hash table in my data structure, can some one tell me how to implement it? I can't find much information about it.
Thanks a lot
Rui
http://www.haskell.org/ghc/docs/6.0/html/base/Data.HashTable.html
There is also the FiniteMap data type which may also please you: http://www.haskell.org/ghc/docs/6.0/html/base/Data.FiniteMap.html
[...]
Wolfgang
r2yang@engmail.uwaterloo.ca wrote:
... hash table in my data structure, can some one tell me how to
implement
it? I can't find much information about it.
Thanks a lot
Rui
http://www.haskell.org/ghc/docs/6.0/html/base/Data.HashTable.html
There is also the FiniteMap data type which may also please you: http://www.haskell.org/ghc/docs/6.0/html/base/Data.FiniteMap.html
And maybe a fast integer finite map may please you even more: http://www.cs.uu.nl/~daan/ddata.html -- Daan Leijen
r2yang:
Hi,all
I'm a new one in this Haskell programming language. I have a program which involved a lot of computation tasks and it's quite inefficient,so I'm currently examing the possibility of using hash table in my data structure, can some one tell me how to implement it? I can't find much information about it.
There is already one implemented in the GHC libraries. If you are using GHC 6, you can import Data.HashTable. Check out: http://www.haskell.org/ghc/docs/latest/html/base/Data.HashTable.html -- Don
"DBS" == Donald Bruce Stewart <dons@cse.unsw.edu.au> writes:
DBS> There is already one implemented in the GHC DBS> libraries. If you are using GHC 6, you can import DBS> Data.HashTable. There is also the older (less efficient?) Data.FiniteMap with very similar functionality. Jens
dons@cse.unsw.edu.au (Donald Bruce Stewart) writes:
I'm a new one in this Haskell programming language.
Okay, since you're new, I won't take your question too literally. :-)
I have a program which involved a lot of computation tasks and it's quite inefficient,so I'm currently examing the possibility of using hash table in my data structure, can some one tell me how to implement it? I can't find much information about it.
http://www.haskell.org/ghc/docs/latest/html/base/Data.HashTable.html
Note that this lives in the IO monad. This may be fine for your purposes, but are you quite sure you need a hash table, and that you can't use either Data.Set or Data.FiniteMap instead? These used balanced trees, and have O(log n) access times, but IME that is fine for most purposes (and given hierarchical memory systems on modern computers, one could argue that you get this from a hash table, too) http://www.haskell.org/ghc/docs/latest/html/base/Data.FiniteMap.html http://www.haskell.org/ghc/docs/latest/html/base/Data.Set.html -kzm -- If I haven't seen further, it is by standing in the footprints of giants
participants (7)
-
Artie Gold -
Daan Leijen -
dons@cse.unsw.edu.au -
Jens Petersen -
ketil+haskell@ii.uib.no -
r2yang@engmail.uwaterloo.ca -
Wolfgang Jeltsch