git.iko.soy/typeable/cabal2nix
on master help sign in
Distribution.Nixpkgs.Fetch: fix a GHC compiler warning
commitd19721cf8b5c0e712638e41a3d187fef31a21680 authorPeter Simons <simons@cryp.to> dateSat 21 Sep 2019, 16:47 (7 years ago) parent8e04b7c
1 file changed+3−1
src/Distribution/Nixpkgs/Fetch.hs+3−1
src/Distribution/Nixpkgs/Fetch.hs+3−1
@@ -161,7 +161,9 @@ fetchWith (supportsRev, kind, addArgs) source = do
161161 ExitFailure _ -> return Nothing
162162 ExitSuccess -> do
163163 buf <- BS.hGetContents stdoutH
164− let (l:ls) = reverse (BS.lines buf)
164+ let (l,ls) = case reverse (BS.lines buf) of
165+ [] -> error "This can't happen, but GHC doesn't know that."
166+ (x:xs) -> (x,xs)
165167 buf' = BS.unlines (reverse ls)
166168 case length ls of
167169 0 -> return Nothing