setBranch :: Monad m => View -> Branch -> Transaction t m ()
setBranch view@(View viewDataIRef) newBranch@(Branch newBranchDataIRef) = do
  let
    branchRef =
      Property.composeLabel vdBranch atViewData $
      Transaction.fromIRef viewDataIRef
  oldBranch@(Branch oldBranchDataIRef) <- Property.get branchRef
  oldVersion <- Branch.curVersion oldBranch
  newVersion <- Branch.curVersion newBranch
  moveView view oldVersion newVersion
  Property.set branchRef newBranch
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef oldBranchDataIRef) (List.delete view)
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef newBranchDataIRef) (view:)
setBranch :: Monad m => View -> Branch -> Transaction t m ()
setBranch view@(View viewDataIRef) newBranch@(Branch newBranchDataIRef) = do
  let
    branchRef =
      Property.composeLabel vdBranch atViewData $
      Transaction.fromIRef viewDataIRef
  oldBranch@(Branch oldBranchDataIRef) <- Property.get branchRef
  oldVersion <- Branch.curVersion oldBranch
  newVersion <- Branch.curVersion newBranch
  moveView view oldVersion newVersion
  Property.set branchRef newBranch
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef oldBranchDataIRef) (List.delete view)
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef newBranchDataIRef) (view:)
setBranch view@(View viewDataIRef) newBranch@(Branch newBranchDataIRef) = do
  let
    branchRef =
      Property.composeLabel vdBranch atViewData $
      Transaction.fromIRef viewDataIRef
  oldBranch@(Branch oldBranchDataIRef) <- Property.get branchRef
  oldVersion <- Branch.curVersion oldBranch
  newVersion <- Branch.curVersion newBranch
  moveView view oldVersion newVersion
  Property.set branchRef newBranch
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef oldBranchDataIRef) (List.delete view)
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef newBranchDataIRef) (view:)