@@ -37,7 +37,7 @@ import Control.Arrow ((&&&))
3737import Control.DeepSeq (NFData )
3838import Control.Exception (Exception )
3939import Control.Monad.Catch (MonadThrow , throwM )
40- import Data.Aeson (FromJSON (.. ), ToJSON (.. ), object , withObject , withText , (.!=) , (.:) , (.:?) , (.=) )
40+ import Data.Aeson (FromJSON (.. ), FromJSONKey ( .. ), ToJSON ( .. ), ToJSONKey (.. ), object , withObject , withText , (.!=) , (.:) , (.:?) , (.=) )
4141import Data.ByteString (ByteString )
4242import qualified Data.ByteString as BS
4343import Data.Data
@@ -281,9 +281,7 @@ newtype Maintainer = Maintainer { unMaintainer :: Text }
281281
282282-- | Name of an executable.
283283newtype ExeName = ExeName { unExeName :: Text }
284- deriving (Show , Eq , Ord , Hashable , IsString , Generic , Store , NFData , Data , Typeable )
285- instance ToJSON ExeName where
286- toJSON = toJSON . unExeName
284+ deriving (Show , Eq , Ord , Hashable , IsString , Generic , Store , NFData , Data , Typeable , ToJSON , ToJSONKey , FromJSONKey )
287285instance FromJSON ExeName where
288286 parseJSON = withText " ExeName" $ return . ExeName
289287
@@ -420,11 +418,6 @@ instance FromJSON Snapshots where
420418 Right (LTS x y) -> return $ IntMap. singleton x y
421419 Right (Nightly _) -> fail " Unexpected nightly value"
422420
423- instance ToJSON a => ToJSON (Map ExeName a ) where
424- toJSON = toJSON . Map. mapKeysWith const unExeName
425- instance FromJSON a => FromJSON (Map ExeName a ) where
426- parseJSON = fmap (Map. mapKeysWith const ExeName ) . parseJSON
427-
428421-- | A simplified version of the 'BuildPlan' + cabal file.
429422data MiniBuildPlan = MiniBuildPlan
430423 { mbpCompilerVersion :: ! CompilerVersion
0 commit comments