-- Get the sum of all priorities by sequentially popping all elements using
-- 'minView'
bench_minView :: OrdPSQ.OrdPSQ Int Int () -> Int
bench_minView = go 0
  where
    go !n t = case OrdPSQ.minView t of
      Nothing            -> n
      Just (k, x, _, t') -> go (n + k + x) t'

-- Empty a queue by sequentially removing all elements
bench_minView :: OrdPSQ.OrdPSQ Int Int () -> Int
bench_minView = go 0
  where
    go !n t = case OrdPSQ.minView t of
      Nothing            -> n
      Just (k, x, _, t') -> go (n + k + x) t'

-- Empty a queue by sequentially removing all elements
bench_minView = go 0
  where
    go !n t = case OrdPSQ.minView t of
      Nothing            -> n
      Just (k, x, _, t') -> go (n + k + x) t'

-- Empty a queue by sequentially removing all elements