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

Language | Haskell2010 |

Classes for common functions between the heaps.

- class IndexedQueue h a where
- class IndexedQueue h a => MeldableIndexedQueue h a where

# Documentation

class IndexedQueue h a where Source #

A classed for indexed priority queues. Equivalent to `Queue`

except the queues are indexed by their sizes.

The empty queue

minView :: h (1 + n) a -> (a, h n a) Source #

Return the minimal element, and the rest of the queue.

singleton :: a -> h 1 a Source #

A queue with one element.

insert :: a -> h n a -> h (1 + n) a Source #

Add an element to the queue.

minViewMay :: h n a -> (n ~ 0 => b) -> (forall m. (1 + m) ~ n => a -> h m a -> b) -> b Source #

Pattern match on the queue, and provide a proof that it is/isn't empty to the caller.

Ord a => IndexedQueue Leftist a Source # | |

Ord a => IndexedQueue Pairing a Source # | |

Ord a => IndexedQueue Skew a Source # | |

IndexedQueue DiffList a Source # | |

IndexedQueue List a Source # | |

Ord a => IndexedQueue Braun a Source # | |

Ord a => IndexedQueue (Binomial 0) a Source # | |

class IndexedQueue h a => MeldableIndexedQueue h a where Source #

Ord a => MeldableIndexedQueue Leftist a Source # | |

Ord a => MeldableIndexedQueue Pairing a Source # | |

Ord a => MeldableIndexedQueue Skew a Source # | |

MeldableIndexedQueue DiffList a Source # | Performs merging in reverse order. |

MeldableIndexedQueue List a Source # | |

Ord a => MeldableIndexedQueue (Binomial 0) a Source # | |