Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kunigami
Last active November 15, 2017 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/8841fff12340bcf30ae6f37c7414b342 to your computer and use it in GitHub Desktop.
Save kunigami/8841fff12340bcf30ae6f37c7414b342 to your computer and use it in GitHub Desktop.
module rec BootstrappedElement: sig
type t = Empty | Heap of Element.t * PrimaryHeap.heap
val compare: t -> t -> int
end = struct
type t = Empty | Heap of Element.t * PrimaryHeap.heap
let compare heap1 heap2 = match (heap1, heap2) with
| (Heap (x, _), Heap (y, _)) -> Element.compare x y
end
and PrimaryHeap: IHeapWithMerge
with type tv := BootstrappedElement.t = SkewBinomialHeap(BootstrappedElement);;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment