aboutsummaryrefslogtreecommitdiff
path: root/Assistant/BranchChange.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-29 19:20:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-29 19:20:54 -0400
commitc65199b29e85cb145d460b9e48fe2fc4a10aeb09 (patch)
treed46f57dc2e021efd8080bc02c9231c603e00963e /Assistant/BranchChange.hs
parentcb504374b53a940ea12feeb5ba91dd78466be455 (diff)
split BranchChange and lifted
Diffstat (limited to 'Assistant/BranchChange.hs')
-rw-r--r--Assistant/BranchChange.hs17
1 files changed, 7 insertions, 10 deletions
diff --git a/Assistant/BranchChange.hs b/Assistant/BranchChange.hs
index cf7080f90..c9354544a 100644
--- a/Assistant/BranchChange.hs
+++ b/Assistant/BranchChange.hs
@@ -7,16 +7,13 @@
module Assistant.BranchChange where
-import Control.Concurrent.MSampleVar
-import Common.Annex
-
-newtype BranchChangeHandle = BranchChangeHandle (MSampleVar ())
+import Assistant.Common
+import Assistant.Types.BranchChange
-newBranchChangeHandle :: IO BranchChangeHandle
-newBranchChangeHandle = BranchChangeHandle <$> newEmptySV
+import Control.Concurrent.MSampleVar
-branchChanged :: BranchChangeHandle -> IO ()
-branchChanged (BranchChangeHandle h) = writeSV h ()
+branchChanged :: Assistant ()
+branchChanged = flip writeSV () <<~ (fromBranchChangeHandle . branchChangeHandle)
-waitBranchChange :: BranchChangeHandle -> IO ()
-waitBranchChange (BranchChangeHandle h) = readSV h
+waitBranchChange :: Assistant ()
+waitBranchChange = readSV <<~ (fromBranchChangeHandle . branchChangeHandle)