From 9cfe0c0ee5e90640563803e1055637237a5670e4 Mon Sep 17 00:00:00 2001 From: Daniel Casanueva Date: Sun, 24 Jul 2016 09:13:46 +0200 Subject: [PATCH] Make ToJSON PackageLocation work as expected from its FromJSON instance. --- src/Stack/Types/Config.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Stack/Types/Config.hs b/src/Stack/Types/Config.hs index 02fe35ff84..651d23ac4f 100644 --- a/src/Stack/Types/Config.hs +++ b/src/Stack/Types/Config.hs @@ -613,8 +613,8 @@ data RemotePackageType instance ToJSON PackageLocation where toJSON (PLFilePath fp) = toJSON fp toJSON (PLRemote t RPTHttp) = toJSON t - toJSON (PLRemote x (RPTGit y)) = toJSON $ T.unwords ["git", x, y] - toJSON (PLRemote x (RPTHg y)) = toJSON $ T.unwords ["hg", x, y] + toJSON (PLRemote x (RPTGit y)) = object [("git", toJSON x), ("commit", toJSON y)] + toJSON (PLRemote x (RPTHg y)) = object [( "hg", toJSON x), ("commit", toJSON y)] instance FromJSON (WithJSONWarnings PackageLocation) where parseJSON v