Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / heap / binomial.fun
CommitLineData
7f918cf1
CE
1(* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8functor EagerBinomialHeap(S: HEAP_STRUCTS): HEAP =
9struct
10
11open S
12
13structure Heap = ForestHeap(structure Key = Key)
14open Heap
15
16val new = newEager
17
18val insert = insertEager
19
20val decreaseKey = decreaseKeySift
21
22val delete = deleteSift
23
24val union = unionEager
25
26end
27
28functor LazyBinomialHeap(S: HEAP_STRUCTS): HEAP =
29struct
30
31open S
32
33structure Heap = ForestHeap(structure Key = Key)
34open Heap
35
36val new = newLazy
37
38val insert = insertLazy
39
40val decreaseKey = decreaseKeySift
41
42val delete = deleteSift
43
44val union = unionLazy
45
46end