[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 15:11:40 UTC 2010


The following commit has been merged in the master branch:
commit ea85ad181b61f967cc2259f180283aaf4318b9d6
Author: John Goerzen <jgoerzen at complete.org>
Date:   Tue Oct 10 21:17:27 2006 +0100

    Updated

diff --git a/MissingH/ProgressTracker.hs b/MissingH/ProgressTracker.hs
index f62953e..0eb4aef 100644
--- a/MissingH/ProgressTracker.hs
+++ b/MissingH/ProgressTracker.hs
@@ -31,7 +31,10 @@ Written by John Goerzen, jgoerzen\@complete.org
 
 -}
 
-module MissingH.ProgressTracker (ProgressRecord(..),
+module MissingH.ProgressTracker (ProgressRecord(completedUnits, totalUnits,
+                                                startTime, trackerName,
+                                                timeSource),
+                                 Progress
                                )
 
 where
@@ -50,7 +53,17 @@ data ProgressRecord =
                      parents :: [Progress],
                      callbacks :: [ProgressCallback]}
 
-type Progress = MVar ProgressRecord
+newtype Progress = Progress (MVar ProgressRecord)
+
+class ProgressTypes a where
+    withStatus :: a -> (ProgressRecord -> IO b) -> IO b
+
+instance ProgressTypes ProgressRecord where
+    withStatus x func = func x
+
+instance ProgressTypes (MVar ProgressRecord) where
+    withStatus x func = withMVar x func
+
+now :: ProgressTypes a => ProgressTimeSource
+now x = withStatus x timeSource
 
--- class ProgressTypes where
---    getStatus 
\ No newline at end of file

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list