[Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Eugene Kirpichov
Hi, I've recently tried to use the priority queue from the ONeillPrimes.hs, which is famous for being a very fast prime generator: actually, I translated the code to Scheme and dropped the values, to end up with a key-only heap implementation. However, the code didn't work quite well, and I

Re: [Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Daniel Fischer
Am Dienstag, 24. Februar 2009 19:16 schrieb Eugene Kirpichov: Hi, I've recently tried to use the priority queue from the ONeillPrimes.hs, which is famous for being a very fast prime generator: actually, I translated the code to Scheme and dropped the values, to end up with a key-only heap

Re: [Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Bertram Felgenhauer
Eugene Kirpichov wrote: Hi, I've recently tried to use the priority queue from the ONeillPrimes.hs, which is famous for being a very fast prime generator: actually, I translated the code to Scheme and dropped the values, to end up with a key-only heap implementation. However, the code didn't

Re: [Haskell-cafe] ONeillPrimes.hs - priority queue broken?

2009-02-24 Thread Bertram Felgenhauer
Eugene Kirpichov wrote: module PQ where import Test.QuickCheck data PriorityQ k v = Lf | Br {-# UNPACK #-} !k v !(PriorityQ k v) !(PriorityQ k v) deriving (Eq, Ord, Read, Show) For the record, we can exploit the invariant that the sizes of the left and