[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:37 UTC 2010
The following commit has been merged in the master branch:
commit deb50d906a733f1b4519aab86e23d4d4667c0e26
Author: John Goerzen <jgoerzen at complete.org>
Date: Tue Oct 10 09:56:56 2006 +0100
Added MissingH.ProgressTracker
diff --git a/MissingH.cabal b/MissingH.cabal
index 7a2416f..66a7213 100644
--- a/MissingH.cabal
+++ b/MissingH.cabal
@@ -20,6 +20,7 @@ Exposed-Modules: MissingH.Str, MissingH.IO, MissingH.IO.Binary, MissingH.List,
MissingH.Regex.Pesco,
MissingH.Str.CSV,
MissingH.Cmd,
+ MissingH.ProgressTracker,
MissingH.FiniteMap, MissingH.Map, MissingH.Path, MissingH.Path.NameManip,
MissingH.Path.FilePath, MissingH.Path.WildMatch, MissingH.Path.Glob,
MissingH.Time, MissingH.Time.ParseDate,
diff --git a/MissingH/Threads.hs b/MissingH/ProgressTracker.hs
similarity index 55%
copy from MissingH/Threads.hs
copy to MissingH/ProgressTracker.hs
index 65686c3..cbc59c7 100644
--- a/MissingH/Threads.hs
+++ b/MissingH/ProgressTracker.hs
@@ -1,5 +1,5 @@
-{- arch-tag: Thread utilities main file
-Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
+{-
+Copyright (C) 2006 John Goerzen <jgoerzen at complete.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,29 +17,29 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-}
{- |
- Module : MissingH.Threads
- Copyright : Copyright (C) 2004 John Goerzen
+ Module : MissingH.ProgressTracker
+ Copyright : Copyright (C) 2006 John Goerzen
License : GNU GPL, version 2 or above
Maintainer : John Goerzen <jgoerzen at complete.org>
Stability : provisional
Portability: portable
-This module provides various helpful utilities for dealing with threads.
+Tools for tracking the status of a long operation.
Written by John Goerzen, jgoerzen\@complete.org
+
-}
-module MissingH.Threads(-- * I\/O utilities
- runInThread
- )
-where
+module MissingH.ProgressTracer (
+ )
-import Control.Concurrent
+where
-{- | Takes a IO action and a function. The IO action will be called in a
-separate thread. When it is completed, the specified function is called with
-its result. This is a simple way of doing callbacks. -}
+data ProgressInfo =
+ ProgressInfo {completedUnits :: Integer,
+ totalUnits :: Integer,
+ startTime :: Integer,
+ trackerName :: String}
+ deriving (Eq, Show, Read)
-runInThread :: IO a -> (a -> IO b) -> IO ThreadId
-runInThread action callback = forkIO $ action >>= callback >> return ()
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list