DData update

JP Bernardy jyp_7 at yahoo.com
Mon May 24 08:14:51 EDT 2004


Hi all,

In the light of the recent discussion, I've updated
DData as such

1. "Seq" has been reverted to what it was (strict
append). If anyone is interested in the fully lazy
version of sequences that I've hacked, I keep it
available under "DData/LazySeq.hs".


2. I've added {# UNPACK #} as suggested. I understand
that it suffices to keep DData on par with
FiniteMap/Set as it exists now. Please correct me if
I'm wrong.

3. I've modified IntSet and IntMap in the same
fashion.

data IntMap a = Nil
              | Tip {-# UNPACK #-} !Key a
              | Bin 
                {-# UNPACK #-} !Prefix 
                {-# UNPACK #-} !Mask 
                !(IntMap a) !(IntMap a) 

-- notice that the Tip is unpacked as well.

That change speeds up the following "benchmark"
twofold.

import DData.IntSet
s = fromList [1..1000000]
main = print $ all (`member` s) [1..1000000]

I did not try to be precise in the measurement, since
it seemed obvious that there was an improvement.

The source is at the usual URL
(users.skynet.be/jyp/DData/ddata.tar.gz) but I have
not updated the docs.

Cheers,
JP.


	
		
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 


More information about the Libraries mailing list