anchor.diff:              VarNeedsVisit = true
           }
       let skel = SV sk
  +    // v is a reactive view of a Tree.
  +    // Whenever there's an outer change, we want to mark this node as dirty.
  +    // When there's an inner change, we mark that the children are dirty and
  +    // should be visited.
       let ver =
           v
           |> R.View.Bind (fun (Tr (ske, y)) ->
  
positive.code:             ElemDirty = true
              NeedsVisit = true
          }
      let skel = SE sk
      let update (a: Ver) (b: Ver) =
          sk.NeedsVisit <- true
          Ver()
      Tr (skel, R.View.Map2 update attrVer ver)
  
  let Empty =
      Tr (S0, R.View.Const (Ver ()))
  
  let appendSkel x y =
      match x, y with
      | S0, r | r, S0 -> r
      | _ -> S2 (x, y)
  
  let Append (Tr (a, aV)) (Tr (b, bV)) =
      Tr (appendSkel a b, R.View.Map2 (fun _ _ -> Ver()) aV bV)
  
  let Concat xs =
      Array.MapReduce (fun x -> x) Empty Append (Seq.toArray xs)
  
  let Element name attr children =
      element (createElement name) (Attrs.Concat attr) (Concat children)
  
  let TextView view =
      let v = R.View.Now view
      let node = createText v
  
negative.code:         | SE x -> BeforeNode x.DomElem
          | ST x -> BeforeNode x.DomText
          | SV x -> posOf x.CurrentSkel
  
      // Update routine. Here we go...
      let rec upd par skel pos =
          match skel with
          | S0 -> pos // At the end of the tree -- do nothing, return current pos
          | S2 (a, b) -> upd par a (upd par b pos) // Update both branches
          | SE e ->
              // Element node update
              JavaScript.Log("upd", e.DomElem)
              // If any of the attributes have been updated, propagate these to
              // this DOM element
              if Attrs.needsUpdate e.AttrsSkel then
                  Attrs.update par e.AttrsSkel
              // If this node has been marked as requiring visitation, clear that
              // flag, and update the child nodes
              if e.NeedsVisit then
                  e.NeedsVisit <- false
                  upd e.DomElem e.Children AtEnd |> ignore
              // If the element has been marked as dirty (that is, the element
              // has changed), reset the dirty flag, and do the required DOM 
              // updates using the Patch function
              if e.ElemDirty then
                  e.ElemDirty <- false
                  patch e.DomElem AtEnd S0 e.Children
              BeforeNode e.DomElem
          // For a text node, set the value of the DOM text node, and mark dirty
          // as false.
          | ST t ->
              if t.TextDirty then
                  JavaScript.Log("update: text := ", t.TextValue)
  