Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell98 |

Intermediate data structure for sorting and paging a result set

When sorting a result set by priority and knowing how many results are requested and which "page" of the result set is requested, a priority queue with limited capacity can be used for efficient sorting and paging.

# Documentation

mkQueue :: Int -> Queue v Source

Create an empty priority queue with a limited capacity. If capacity is < 0, no limit is set

insert :: Ord v => v -> Queue v -> Queue v Source

Insert an element if there is space in the queue or if the element is larger than the smallest element.