diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-29 19:35:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-29 19:35:18 -0400 |
commit | de83800ab39649992cd7f9ae61689820138613bd (patch) | |
tree | b0010403a376694f42cc3e36d8ccc3b5365c9d65 /Assistant/Commits.hs | |
parent | 4c12d38e33923c929a1a264d5b511fb5b8afdf33 (diff) |
split Commits and lifted
Diffstat (limited to 'Assistant/Commits.hs')
-rw-r--r-- | Assistant/Commits.hs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/Assistant/Commits.hs b/Assistant/Commits.hs index 6c27ce3cb..79555fee5 100644 --- a/Assistant/Commits.hs +++ b/Assistant/Commits.hs @@ -7,25 +7,21 @@ module Assistant.Commits where -import Utility.TSet - -type CommitChan = TSet Commit +import Assistant.Common +import Assistant.Types.Commits -data Commit = Commit - -newCommitChan :: IO CommitChan -newCommitChan = newTSet +import Utility.TSet {- Gets all unhandled commits. - Blocks until at least one commit is made. -} -getCommits :: CommitChan -> IO [Commit] -getCommits = getTSet +getCommits :: Assistant [Commit] +getCommits = getTSet <<~ commitChan {- Puts unhandled commits back into the channel. - Note: Original order is not preserved. -} -refillCommits :: CommitChan -> [Commit] -> IO () -refillCommits = putTSet +refillCommits :: [Commit] -> Assistant () +refillCommits cs = flip putTSet cs <<~ commitChan {- Records a commit in the channel. -} -recordCommit :: CommitChan -> IO () -recordCommit = flip putTSet1 Commit +recordCommit :: Assistant () +recordCommit = flip putTSet1 Commit <<~ commitChan |