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

Neil Mitchell NeilMitchell
Fri Apr 23 15:21:54 UTC 2010


The following commit has been merged in the master branch:
commit 3563f5ec50056f5c4def483573d6888c839a5e5d
Author: Neil Mitchell <Neil Mitchell>
Date:   Fri Dec 8 20:41:33 2006 +0100

    Add a tuple utilities module, containing fst3..thd3

diff --git a/MissingH.cabal b/MissingH.cabal
index b2139da..38b63da 100644
--- a/MissingH.cabal
+++ b/MissingH.cabal
@@ -34,6 +34,7 @@ Exposed-Modules: Data.String, System.IO.Utils, System.IO.Binary, Data.List.Utils
   Network.SocketServer,
   Data.Either.Utils,
   Data.Maybe.Utils,
+  Data.Tuple.Utils,
   Data.Bits.Utils,
   Data.Hash.CRC32.Posix, Data.Hash.CRC32.GZip,
    Data.Hash.MD5, Data.Hash.MD5.Zord64_HARD,
diff --git a/src/Control/Concurrent/Thread/Utils.hs b/src/Data/Tuple/Utils.hs
similarity index 55%
copy from src/Control/Concurrent/Thread/Utils.hs
copy to src/Data/Tuple/Utils.hs
index 5764606..a25668d 100644
--- a/src/Control/Concurrent/Thread/Utils.hs
+++ b/src/Data/Tuple/Utils.hs
@@ -1,5 +1,5 @@
-{- arch-tag: Thread utilities main file
-Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
+{- arch-tag: Tuple utilities main file
+Copyright (C) 2004-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,33 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
 {- |
-   Module     : Control.Concurrent.Thread.Utils
-   Copyright  : Copyright (C) 2004 John Goerzen
+   Module     : Data.Tuple.Utils
+   Copyright  : Copyright (C) 2004-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.
+This module provides various helpful utilities for dealing with lists.
 
-Written by John Goerzen, jgoerzen\@complete.org
+Written by Neil Mitchell, http://www.cs.york.ac.uk/~ndm/
 -}
 
-module Control.Concurrent.Thread.Utils(-- * I\/O utilities
-                        runInThread
-                       )
-where
+module Data.Tuple.Utils(
+    -- * Extraction
+    fst3, snd3, thd3
+    ) where
 
-import Control.Concurrent
 
-{- | 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. -}
+-- | Take the first item out of a 3 element tuple
+fst3 :: (a,b,c) -> a
+fst3 (a,b,c) = a
 
-runInThread :: IO a -> (a -> IO b) -> IO ThreadId
-runInThread action callback = forkIO $ action >>= callback >> return ()
+-- | Take the second item out of a 3 element tuple
+snd3 :: (a,b,c) -> b
+snd3 (a,b,c) = b
+
+-- | Take the third item out of a 3 element tuple
+thd3 :: (a,b,c) -> c
+thd3 (a,b,c) = c

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list