anchor.diff:        // This adds new ToDo items in response to Enter key presses on the
         // EnterHeader text box.
         Stream.ofObservableOnMain main.EnterHeader.KeyUp
  -      |> Stream.filterFun (fun evt -> evt.Key = Key.Enter)
  -      |> Stream.chooseJob (fun _ -> onMain {
  -         return match main.EnterHeader.Text.Trim () with
  -                 | "" -> None
  -                 | header ->
  -                   main.EnterHeader.Text <- ""
  -                   Some header })
  -      |> Stream.consumeJob (fun header ->
  -         Stream.MVar.updateFun modelMVar
  -          <| Map.add (Id.next ()) {IsCompleted = false; Header = header})
  +      |> Stream.filterFun ^ fun evt -> evt.Key = Key.Enter
  +      |> Stream.chooseJob ^ fun _ -> onMain {
  +           return match main.EnterHeader.Text.Trim () with
  +                   | "" -> None
  +                   | header ->
  +                     main.EnterHeader.Text <- ""
  +                     Some header
  +         }
  +      |> Stream.consumeJob ^ fun header ->
  +           Stream.MVar.updateFun modelMVar ^
  +             Map.add (Id.next ()) {IsCompleted = false; Header = header}
   
         // Filtering predicates on ToDo items.
         let isAny _ = true
  
positive.code:         // absolute guarantee that elements from the MouseEnter stream would
          // always precede elements from the MouseLeave stream.
          Stream.merge
            (Stream.ofObservableOnMain control.MouseEnter |> Stream.mapConst +1)
            (Stream.ofObservableOnMain control.MouseLeave |> Stream.mapConst -1)
          |> Stream.scanFromFun 0 (+)
          |> Stream.keepPreceding1
          |> Stream.consumeJob (fun n -> onMain {
             control.Remove.Visibility <-
               if 0 < n then Visibility.Visible else Visibility.Hidden })
  
          // This removes the item from the model if the Remove button is clicked.
          Stream.ofObservableOnMain control.Remove.Click
          |> Stream.consumeJob (fun _ ->
             Stream.MVar.updateFun modelMVar <| Map.remove id)
  
          control
  
  
negative.code:         // This updates the underlying item in response to a click on the
          // completed checkbox.
          Stream.ofObservableOnMain control.IsCompleted.Click
          |> Stream.consumeJob ^ fun _ -> onMain {
               let isCompleted = control.IsCompleted.IsChecked.Value
               return! Stream.MVar.updateFun modelMVar ^
                         updateItem id ^ fun item ->
                           {item with IsCompleted = isCompleted}
             }
  
          // This enables editing the header of a ToDo item.
          Stream.ofObservableOnMain control.Header.MouseDoubleClick
          |> Stream.consumeJob ^ fun _ -> onMain {
               control.Header.Focusable <- true
               if control.Header.Focus () then
                 control.Header.SelectAll ()
             }
  
          // This finalizes the editing of a ToDo item header after Enter key is
          // pressed or after focus is lost.  If the header would become empty
          // after trimming, the edit is ignored.
          Stream.ofObservableOnMain control.Header.KeyUp
          |> Stream.filterFun ^ fun evt -> evt.Key = Key.Enter
          |> Stream.mapIgnore
          |> Stream.merge (Stream.ofObservableOnMain control.Header.LostFocus
                           |> Stream.mapIgnore)
          |> Stream.consumeJob ^ fun () -> onMain {
               Keyboard.ClearFocus ()
               control.Header.Focusable <- false
               match control.Header.Text.Trim () with
                 | "" -> control.Header.Text <- item.Header
                 | header ->
                   return! Stream.MVar.updateFun modelMVar ^
                             updateItem id ^ fun item ->
                               {item with Header = header}
             }
  
          // This shows the Remove button of a ToDo item when the mouse is over
          // the item.  The stream is carefully constructed to avoid problems due
  