File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change
1
+ {-# LANGUAGE DataKinds #-}
2
+ {-# LANGUAGE GADTs #-}
1
3
{-# LANGUAGE PackageImports #-}
4
+
2
5
module Progress (tests ) where
3
6
4
7
import Control.Concurrent.STM
@@ -44,15 +47,15 @@ reportProgressTests = testGroup "recordProgress"
44
47
InProgressModel {.. } <- p
45
48
(done, todo) @?= (length (filter (== 0 ) (Map. elems current)), Map. size current)
46
49
47
- fromModel :: InProgressModel -> IO InProgressState
50
+ fromModel :: InProgressModel -> IO ( InProgressState 'ProgressStateInsideTracking)
48
51
fromModel InProgressModel {.. } = do
49
52
doneVar <- newTVarIO done
50
53
todoVar <- newTVarIO todo
51
54
currentVar <- STM. newIO
52
55
atomically $ for_ (Map. toList current) $ \ (k,v) -> STM. insert v k currentVar
53
56
return InProgressState {.. }
54
57
55
- toModel :: InProgressState -> IO InProgressModel
58
+ toModel :: InProgressState 'ProgressStateInsideTracking -> IO InProgressModel
56
59
toModel InProgressState {.. } = atomically $ do
57
60
done <- readTVar doneVar
58
61
todo <- readTVar todoVar
You can’t perform that action at this time.
0 commit comments