main :: IO ()
main = do
    gen <- create
    ws <- uniformRs (1,256) gen numOfStreams
    let ks = [1,3..]
        xs = zip ks ws
    defaultMain [
        bgroup "enqueue & dequeue" [
              bench "Random Skew Heap"      $ whnf enqdeqR xs
            , bench "Skew Binomial Heap"    $ whnf enqdeqO xs
            , bench "Priority Search Queue" $ whnf enqdeqP xs
            , bench "Binary Heap"           $ nfIO (enqdeqBIO xs)
            , bench "Binary Heap STM"       $ nfIO (enqdeqB xs)
            , bench "Ring of Queues"        $ nfIO (enqdeqAIO xs)
            , bench "Ring of Queues STM"    $ nfIO (enqdeqA xs)
            ]
      , bgroup "delete" [
              bench "Random Skew Heap"      $ whnf deleteR xs
            , bench "Skew Binomial Heap"    $ whnf deleteO xs
            , bench "Priority Search Queue" $ whnf deleteP xs
            , bench "Binary Heap"           $ nfIO (deleteBIO xs)
            , bench "Binary Heap STM"       $ nfIO (deleteB xs)
            , bench "Ring of Queues IO"     $ nfIO (deleteAIO xs)
            ]
      ]
  where
    uniformRs range gen n = loop n []
      where
        loop 0 rs = return rs
        loop i rs = do
            r <- uniformR range gen
            loop (i-1) (r:rs)

----------------------------------------------------------------
main :: IO ()
main = do
    gen <- create
    ws <- uniformRs (1,256) gen numOfStreams
    let ks = [1,3..]
        xs = zip ks ws
    defaultMain [
        bgroup "enqueue & dequeue" [
              bench "Random Skew Heap"      $ whnf enqdeqR xs
            , bench "Skew Binomial Heap"    $ whnf enqdeqO xs
            , bench "Priority Search Queue" $ whnf enqdeqP xs
            , bench "Binary Heap"           $ nfIO (enqdeqBIO xs)
            , bench "Binary Heap STM"       $ nfIO (enqdeqB xs)
            , bench "Ring of Queues"        $ nfIO (enqdeqAIO xs)
            , bench "Ring of Queues STM"    $ nfIO (enqdeqA xs)
            ]
      , bgroup "delete" [
              bench "Random Skew Heap"      $ whnf deleteR xs
            , bench "Skew Binomial Heap"    $ whnf deleteO xs
            , bench "Priority Search Queue" $ whnf deleteP xs
            , bench "Binary Heap"           $ nfIO (deleteBIO xs)
            , bench "Binary Heap STM"       $ nfIO (deleteB xs)
            , bench "Ring of Queues IO"     $ nfIO (deleteAIO xs)
            ]
      ]
  where
    uniformRs range gen n = loop n []
      where
        loop 0 rs = return rs
        loop i rs = do
            r <- uniformR range gen
            loop (i-1) (r:rs)

----------------------------------------------------------------
main = do
    gen <- create
    ws <- uniformRs (1,256) gen numOfStreams
    let ks = [1,3..]
        xs = zip ks ws
    defaultMain [
        bgroup "enqueue & dequeue" [
              bench "Random Skew Heap"      $ whnf enqdeqR xs
            , bench "Skew Binomial Heap"    $ whnf enqdeqO xs
            , bench "Priority Search Queue" $ whnf enqdeqP xs
            , bench "Binary Heap"           $ nfIO (enqdeqBIO xs)
            , bench "Binary Heap STM"       $ nfIO (enqdeqB xs)
            , bench "Ring of Queues"        $ nfIO (enqdeqAIO xs)
            , bench "Ring of Queues STM"    $ nfIO (enqdeqA xs)
            ]
      , bgroup "delete" [
              bench "Random Skew Heap"      $ whnf deleteR xs
            , bench "Skew Binomial Heap"    $ whnf deleteO xs
            , bench "Priority Search Queue" $ whnf deleteP xs
            , bench "Binary Heap"           $ nfIO (deleteBIO xs)
            , bench "Binary Heap STM"       $ nfIO (deleteB xs)
            , bench "Ring of Queues IO"     $ nfIO (deleteAIO xs)
            ]
      ]
  where
    uniformRs range gen n = loop n []
      where
        loop 0 rs = return rs
        loop i rs = do
            r <- uniformR range gen
            loop (i-1) (r:rs)

----------------------------------------------------------------