1{-# LANGUAGE BangPatterns #-}
10import Control.Concurrent (forkIO)
11import Control.Concurrent.MVar (MVar, newEmptyMVar, newMVar, putMVar, takeMVar)
12import qualified Data.Binary as Binary
13import Data.Foldable (traverse_)
23 Scope (MVar [MVar ()])
26withScope :: (Scope -> IO a) -> IO a
28 do workList <- newMVar []
29 result <- callback (Scope workList)
30 mvars <- takeMVar workList
31 traverse_ takeMVar mvars
35writeBinary :: (Binary.Binary a) => Scope -> FilePath -> a -> IO ()
36writeBinary (Scope workList) path value =
37 do mvar <- newEmptyMVar
38 _ <- forkIO (File.writeBinary path value >> putMVar mvar ())
39 oldWork <- takeMVar workList
40 let !newWork = mvar:oldWork
41 putMVar workList newWork
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list