[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 14:45:03 UTC 2010


The following commit has been merged in the master branch:
commit c030f9747571823dc4681131d41fd9ae2529d8b7
Author: John Goerzen <jgoerzen at complete.org>
Date:   Thu Oct 21 17:30:50 2004 +0100

    Various enhancements to FiniteMap, etc.
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--1.0--patch-90)

diff --git a/ChangeLog b/ChangeLog
index 6e03e8d..3231e8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,19 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--1.0
 #
 
+2004-10-21 11:30:50 GMT	John Goerzen <jgoerzen at complete.org>	patch-90
+
+    Summary:
+      Various enhancements to FiniteMap, etc.
+    Revision:
+      missingh--head--1.0--patch-90
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/FiniteMap.hs libsrc/MissingH/List.hs
+     testsrc/FiniteMaptest.hs
+
+
 2004-10-21 03:45:38 GMT	John Goerzen <jgoerzen at complete.org>	patch-89
 
     Summary:
diff --git a/libsrc/MissingH/FiniteMap.hs b/libsrc/MissingH/FiniteMap.hs
index 7867ce2..2da6261 100644
--- a/libsrc/MissingH/FiniteMap.hs
+++ b/libsrc/MissingH/FiniteMap.hs
@@ -29,6 +29,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 This module provides various helpful utilities for dealing with FiniteMaps.
 
 Written by John Goerzen, jgoerzen\@complete.org
+
+In addition to the functions exported, this module also makes a FiniteMap
+showable.
 -}
 
 module MissingH.FiniteMap (flipFM)
@@ -42,3 +45,7 @@ function for lists. -}
 
 flipFM :: (Ord key, Ord val) => FiniteMap key val -> FiniteMap val [key]
 flipFM = listToFM . flipAL . fmToList
+
+{- | Makes a FiniteMap showable. -}
+instance (Show a, Show b) => Show (FiniteMap a b) where
+    show fm = show (fmToList fm)
diff --git a/libsrc/MissingH/List.hs b/libsrc/MissingH/List.hs
index 025cbb2..328f07a 100644
--- a/libsrc/MissingH/List.hs
+++ b/libsrc/MissingH/List.hs
@@ -159,7 +159,7 @@ matches the given one. -}
 delFromAL :: Eq key => [(key, a)] -> key -> [(key, a)]
 delFromAL l key = filter (\a -> (fst a) /= key) l
 
-{- Flips an association list.  Converts (key1, val), (key2, val) pairs
+{- | Flips an association list.  Converts (key1, val), (key2, val) pairs
 to (val, [key1, key2]). -}
 flipAL :: (Eq key, Eq val) => [(key, val)] -> [(val, [key])]
 flipAL oldl =
diff --git a/testsrc/FiniteMaptest.hs b/testsrc/FiniteMaptest.hs
index 6b6e19b..0de8ed8 100644
--- a/testsrc/FiniteMaptest.hs
+++ b/testsrc/FiniteMaptest.hs
@@ -21,9 +21,6 @@ import HUnit
 import MissingH.FiniteMap
 import Data.FiniteMap
 
-instance (Show a, Show b) => Show (FiniteMap a b) where
-    show fm = show (fmToList fm)
-
 test_flipFM =
     let f inp exp = (listToFM exp) @=? flipFM (listToFM inp) in
         do

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list