rge h1@(Node p1 k1 l1 r1) h2@(Node p2 k2 l2 r2) = case p1 < p2 of
  True  -> makeT p1 l1 (merge r1 (Node p2 k2 l2 r2))
  False -> makeT p2 l2 (merge (Node p1 k1 l1 r1) r2)

-- Inserting into a heap is performed by merging that heap with newly
-- created singleton heap.
[
merge h1@(Node p1 k1 l1 r1) h2@(Node p2 k2 l2 r2) = case p1 < p2 of
  True  -> makeT p1 l1 (merge r1 (Node p2 k2 l2 r2))
  False -> makeT p2 l2 (merge (Node p1 k1 l1 r1) r2)

-- Inserting into a heap is performed by merging that heap with newly
-- created singleton heap.
merge h1@(Node p1 k1 l1 r1) h2@(Node p2 k2 l2 r2) = case p1 < p2 of
  True  -> makeT p1 l1 (merge r1 (Node p2 k2 l2 r2))
  False -> makeT p2 l2 (merge (Node p1 k1 l1 r1) r2)

-- Inserting into a heap is performed by merging that heap with newly
-- created singleton heap.