entryToPackageDescription :: (MonadBaseControl IO m, MonadIO m) => Request -> Manager
                          -> Conduit Tar.Entry m (D.PackageDescription, UTCTime)
entryToPackageDescription req mgr =
    CL.filter isCabalFile =$
    CL.mapMaybe (normalFileContent . Tar.entryContent) =$
    CL.mapMaybe (resultMaybe . D.parsePackageDescription . L.unpack) =$
    CL.map D.flattenPackageDescription =$
    CL.groupBy ((==) `on` (D.pkgName . D.package)) =$
    CL.map (maximumBy (compare `on` (D.pkgVersion . D.package))) =$
    CL.mapM (\pd -> (pd,) <$> getLastUploaded (D.display . D.pkgName $ D.package pd) req mgr)
entryToPackageDescription :: (MonadBaseControl IO m, MonadIO m) => Request -> Manager
                          -> Conduit Tar.Entry m (D.PackageDescription, UTCTime)
entryToPackageDescription req mgr =
    CL.filter isCabalFile =$
    CL.mapMaybe (normalFileContent . Tar.entryContent) =$
    CL.mapMaybe (resultMaybe . D.parsePackageDescription . L.unpack) =$
    CL.map D.flattenPackageDescription =$
    CL.groupBy ((==) `on` (D.pkgName . D.package)) =$
    CL.map (maximumBy (compare `on` (D.pkgVersion . D.package))) =$
    CL.mapM (\pd -> (pd,) <$> getLastUploaded (D.display . D.pkgName $ D.package pd) req mgr)
entryToPackageDescription req mgr =
    CL.filter isCabalFile =$
    CL.mapMaybe (normalFileContent . Tar.entryContent) =$
    CL.mapMaybe (resultMaybe . D.parsePackageDescription . L.unpack) =$
    CL.map D.flattenPackageDescription =$
    CL.groupBy ((==) `on` (D.pkgName . D.package)) =$
    CL.map (maximumBy (compare `on` (D.pkgVersion . D.package))) =$
    CL.mapM (\pd -> (pd,) <$> getLastUploaded (D.display . D.pkgName $ D.package pd) req mgr)