new :: Monad m => Branch -> Transaction t m View
new br@(Branch branchDataIRef) = do
  view <- View `liftM` Transaction.newIRef (ViewData br)
  version <- Branch.curVersion br
  applyHistory view =<< Version.versionData version
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef branchDataIRef) (view:)
  return view
  where
    applyHistory view versionData = do
      maybe (return ()) (applyHistory view <=< Version.versionData) . Version.parent $ versionData
      applyChangesToView view Change.newValue $ Version.changes versionData
new :: Monad m => Branch -> Transaction t m View
new br@(Branch branchDataIRef) = do
  view <- View `liftM` Transaction.newIRef (ViewData br)
  version <- Branch.curVersion br
  applyHistory view =<< Version.versionData version
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef branchDataIRef) (view:)
  return view
  where
    applyHistory view versionData = do
      maybe (return ()) (applyHistory view <=< Version.versionData) . Version.parent $ versionData
      applyChangesToView view Change.newValue $ Version.changes versionData
new br@(Branch branchDataIRef) = do
  view <- View `liftM` Transaction.newIRef (ViewData br)
  version <- Branch.curVersion br
  applyHistory view =<< Version.versionData version
  Property.pureModify (Property.composeLabel brViews atBrViews $ Transaction.fromIRef branchDataIRef) (view:)
  return view
  where
    applyHistory view versionData = do
      maybe (return ()) (applyHistory view <=< Version.versionData) . Version.parent $ versionData
      applyChangesToView view Change.newValue $ Version.changes versionData