Commit 92b28956 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Fix instances of 'PyValue'



Fix instances of 'PyValue', namely, for tuples and maps.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent f2cf4da2
......@@ -46,7 +46,7 @@ instance PyValue Double
instance PyValue Char
instance (PyValue a, PyValue b) => PyValue (a, b) where
showValue (x, y) = show (showValue x, showValue y)
showValue (x, y) = "(" ++ showValue x ++ "," ++ showValue y ++ ")"
instance PyValue String where
showValue = show
......@@ -57,7 +57,7 @@ instance PyValue a => PyValue [a] where
instance (PyValue k, PyValue a) => PyValue (Map k a) where
showValue mp =
"{" ++ intercalate ", " (map showPair (Map.assocs mp)) ++ "}"
where showPair (k, x) = show k ++ ":" ++ show x
where showPair (k, x) = showValue k ++ ":" ++ showValue x
instance PyValue a => PyValue (ListSet a) where
showValue = showValue . Set.toList . unListSet
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment