projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e771c40
)
Let zipValueMapsWith show the trees in the error.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 19 Feb 2009 12:11:24 +0000
(13:11 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 19 Feb 2009 12:11:24 +0000
(13:11 +0100)
HsValueMap.hs
patch
|
blob
|
history
diff --git
a/HsValueMap.hs
b/HsValueMap.hs
index 97e4cdb5d261f33c9f642e9b4c059f628a0ff5b5..f4498f20102a64d633859e2d06487c3963842ee1 100644
(file)
--- a/
HsValueMap.hs
+++ b/
HsValueMap.hs
@@
-57,15
+57,16
@@
mkHsValueMap ty =
-- | Creates a map of pairs from two maps. The maps must have the same
-- structure.
-- | Creates a map of pairs from two maps. The maps must have the same
-- structure.
-zipValueMaps :: HsValueMap a -> HsValueMap b -> HsValueMap (a, b)
+zipValueMaps ::
(Show a, Show b) =>
HsValueMap a -> HsValueMap b -> HsValueMap (a, b)
zipValueMaps = zipValueMapsWith (\a b -> (a, b))
-- | Creates a map of two maps using the given combination function.
zipValueMaps = zipValueMapsWith (\a b -> (a, b))
-- | Creates a map of two maps using the given combination function.
-zipValueMapsWith :: (a -> b -> c) -> HsValueMap a -> HsValueMap b -> HsValueMap c
+zipValueMapsWith :: (
Show a, Show b) => (
a -> b -> c) -> HsValueMap a -> HsValueMap b -> HsValueMap c
zipValueMapsWith f (Tuple as) (Tuple bs) =
Tuple $ zipWith (zipValueMapsWith f) as bs
zipValueMapsWith f (Single a) (Single b) =
Single $ f a b
zipValueMapsWith f (Tuple as) (Tuple bs) =
Tuple $ zipWith (zipValueMapsWith f) as bs
zipValueMapsWith f (Single a) (Single b) =
Single $ f a b
-zipValueMapWith _ _ _ =
- error $ "Trying to zip unsimilarly formed trees!"
+zipValueMapsWith _ a b =
+ --Tuple []
+ error $ "Trying to zip unsimilarly formed trees!\n" ++ (show a) ++ "\nand\n" ++ (show b)