[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:05:21 UTC 2010
The following commit has been merged in the master branch:
commit 51a79a8aab2ee95ffa00dea36e599b998c9f525b
Author: John Goerzen <jgoerzen at complete.org>
Date: Tue Dec 27 03:26:36 2005 +0100
Adjusted arg order in MissingH.Map
Convention in Data.Map has some args in opposite order from the convention
in FiniteMap. Adjust this module and its tests to match.
diff --git a/MissingH/Map.hs b/MissingH/Map.hs
index 3cc5359..d3c4ca4 100644
--- a/MissingH/Map.hs
+++ b/MissingH/Map.hs
@@ -75,8 +75,8 @@ flipM = Data.Map.fromList . flipAL . Data.Map.toList
parameter. If the value does not occur in the Map, the empty
list is returned. -}
-flippedLookupM :: (Ord val, Ord key) => Data.Map.Map key val -> val-> [key]
-flippedLookupM fm v =
+flippedLookupM :: (Ord val, Ord key) => val -> Data.Map.Map key val -> [key]
+flippedLookupM v fm =
case Data.Map.lookup v (flipM fm) of
Nothing -> []
Just x -> x
@@ -84,9 +84,9 @@ flippedLookupM fm v =
{- | Performs a lookup, and raises an exception (with an error message
prepended with the given string) if the key could not be found.
-}
-forceLookupM :: (Show key, Ord key) => String ->
- Data.Map.Map key elt -> key -> elt
-forceLookupM msg fm k =
+forceLookupM :: (Show key, Ord key) => String -> key ->
+ Data.Map.Map key elt -> elt
+forceLookupM msg k fm =
case Data.Map.lookup k fm of
Just x -> x
Nothing -> error $ msg ++ ": could not find key " ++ (show k)
diff --git a/testsrc/Maptest.hs b/testsrc/Maptest.hs
index ebc690b..0c9b5dc 100644
--- a/testsrc/Maptest.hs
+++ b/testsrc/Maptest.hs
@@ -34,7 +34,7 @@ test_flipM =
]
test_flippedLookupM =
- let f item inp exp = TestCase $ exp @=? flippedLookupM (M.fromList inp) item in
+ let f item inp exp = TestCase $ exp @=? flippedLookupM item (M.fromList inp) in
[
f 'a' ([]::[(Char, Char)]) []
,f 'a' [("Test1", 'a'), ("Test2", 'b')] ["Test1"]
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list