@@ -76,10 +76,14 @@ instance IsString Dependency where
7676instance IsString CompilerId where
7777 fromString = text2isString "CompilerId"
7878
79+instance IsString Platform where
80+ fromString "i686-linux" = Platform I386 Linux
81+ fromString "x86_64-linux" = Platform X86_64 Linux
82+ fromString "x86_64-darwin" = Platform X86_64 (OtherOS "darwin")
83+ fromString s = error ("fromString: " ++ show s ++ " is not a valid platform")
84+
7985instance FromJSON Platform where
80− parseJSON (String "i686-linux") = pure (Platform I386 Linux)
81− parseJSON (String "x86_64-linux") = pure (Platform X86_64 Linux)
82− parseJSON (String "x86_64-darwin") = pure (Platform X86_64 (OtherOS "darwin"))
86+ parseJSON (String s) = pure (fromString (T.unpack s))
8387 parseJSON s = fail ("parseJSON: " ++ show s ++ " is not a valid platform")
8488
8589instance FromJSON PackageName where