git.iko.soy/typeable/cabal2nix
on master help sign in
hackage2nix: replace deprecated Aeson.decodeFile with decodeFileEither
commit143cae17d9c94c91cc4fb47b17bbf92505d9894f authorPeter Simons <simons@cryp.to> dateThu 26 Apr 2018, 08:53 (9 years ago) parent7882850
1 file changed+2−1
src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration.hs+2−1
src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration.hs+2−1
@@ -7,6 +7,7 @@
77
88module Distribution.Nixpkgs.Haskell.FromCabal.Configuration ( Configuration(..), readConfiguration, assertConsistency ) where
99
10+import Control.Exception ( throwIO )
1011import Control.DeepSeq
1112import Control.Lens
1213import Control.Monad
@@ -94,7 +95,7 @@ parseKey s = either error id (parseEither parseJSON (String s))
9495
9596readConfiguration :: FilePath -> IO Configuration
9697readConfiguration path =
97− decodeFile path >>= maybe (fail ("invalid config file at " ++ show path)) assertConsistency
98+ decodeFileEither path >>= either throwIO assertConsistency
9899
99100assertConsistency :: Monad m => Configuration -> m Configuration
100101assertConsistency cfg@Configuration {..} = do