heapFromChildren (r, NODE x (t:ts)) acc =
  heapFromChildren (r - 1, NODE x ts) ((r - 1, t) : acc)
heapFromChildren (r, NODE x (t:ts)) acc =
  heapFromChildren (r - 1, NODE x ts) ((r - 1, t) : acc)
heapFromChildren (r, NODE x (t:ts)) acc =
  heapFromChildren (r - 1, NODE x ts) ((r - 1, t) : acc)