anchor.diff:          private
               { Depth : int
                 Bounds : Vector4
  -              Children : 'e SpatialNode array
  -              Elements : 'e HashSet }
  +              Children : Either<'e SpatialNode array, 'e HashSet> }
   
       [<RequireQualifiedAccess>]
       module internal SpatialNode =
  
positive.code:     [<RequireQualifiedAccess>]
      module SpatialTree =
      
          let addElement omnipresence bounds element tree =
              if omnipresence then 
                  tree.OmnipresentElements.Add element |> ignore
              elif not ^ SpatialNode.inBounds bounds tree.Node then
                  Log.info "Element is outside of spatial tree's containment area or is being added redundantly."
                  tree.OmnipresentElements.Add element |> ignore
              else SpatialNode.addElement bounds element tree.Node
  
          let removeElement omnipresence bounds element tree =
              if omnipresence then 
                  tree.OmnipresentElements.Remove element |> ignore
              elif not ^ SpatialNode.inBounds bounds tree.Node then
                  Log.info "Element is outside of spatial tree's containment area or is not present for removal."
                  tree.OmnipresentElements.Remove element |> ignore
              else SpatialNode.removeElement bounds element tree.Node
      
          let updateElement
              oldOmnipresence oldBounds
              newOmnipresence newBounds
              element tree =
              // OPTIMIZATION: only update when element is not omnipresent
              if oldOmnipresence && newOmnipresence then
                  // TODO: P1: OPTIMIZATION: only update when element is computed to have changed nodes
                  removeElement oldOmnipresence oldBounds element tree
                  addElement newOmnipresence newBounds element tree
  
          let getElementsAtPoint point tree =
              let list = List tree.OmnipresentElements
              SpatialNode.getElementsAtPoint point tree.Node list
              list
      
          let getElementsInBounds bounds tree =
              let list = List tree.OmnipresentElements
              SpatialNode.getElementsInBounds bounds tree.Node list
              list
      
          let getDepth tree =
              SpatialNode.getDepth tree.Node
  
negative.code:             Math.isBoundsIntersectingBounds bounds node.Bounds
  
          let rec internal addElement bounds element node =
              if intersectingBounds bounds node then
                  match node.Children with
                  | Left nodes -> for node in nodes do addElement bounds element node
                  | Right elements -> elements.Add element |> ignore
  
          let rec internal removeElement bounds element node =
              if intersectingBounds bounds node then
                  match node.Children with
                  | Left nodes -> for node in nodes do removeElement bounds element node
                  | Right elements -> elements.Remove element |> ignore
  
          let rec internal updateElement oldBounds newBounds element node =
              match node.Children with
              | Left nodes ->
                  for node in nodes do
                      if intersectingBounds oldBounds node || intersectingBounds newBounds node then
                          updateElement oldBounds newBounds element node
              | Right elements ->
                  if intersectingBounds oldBounds node then
                      if not (intersectingBounds newBounds node) then elements.Remove element |> ignore
                  elif intersectingBounds newBounds node then
                      elements.Add element |> ignore
  
          let rec internal getElementsAtPoint point node (set : 'e HashSet) =
              match node.Children with
              | Left nodes -> for node in nodes do if atPoint point node then getElementsAtPoint point node set
              | Right elements -> for element in elements do set.Add element |> ignore
  
          let rec internal getElementsInBounds bounds node (set : 'e HashSet) =
              match node.Children with
              | Left nodes -> for node in nodes do if intersectingBounds bounds node then getElementsInBounds bounds node set
              | Right elements -> for element in elements do set.Add element |> ignore
  
          let internal getDepth node =
              node.Depth
  