diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-29 19:20:54 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-29 19:20:54 -0400 |
commit | c65199b29e85cb145d460b9e48fe2fc4a10aeb09 (patch) | |
tree | d46f57dc2e021efd8080bc02c9231c603e00963e /Assistant/BranchChange.hs | |
parent | cb504374b53a940ea12feeb5ba91dd78466be455 (diff) |
split BranchChange and lifted
Diffstat (limited to 'Assistant/BranchChange.hs')
-rw-r--r-- | Assistant/BranchChange.hs | 17 |
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) |