hackage-processing 0.0 → 0.0.0.1
raw patch · 2 files changed
+11/−7 lines, 2 filesdep ~base
Dependency ranges changed: base
Files
- hackage-processing.cabal +4/−4
- src/Main.hs +7/−3
hackage-processing.cabal view
@@ -1,12 +1,12 @@ Name: hackage-processing-Version: 0.0+Version: 0.0.0.1 Synopsis: Process 00-index.tar.gz from Hackage Description: Currently it only contains a program for fetching contributions of an author to Hackage and format it as a LaTeX table. .- > hackage-find-contribution thielemann+ > hackage-find-contribution henning-thielemann.de Homepage: http://hub.darcs.net/thielema/hackage-processing License: BSD3 License-File: LICENSE@@ -17,7 +17,7 @@ Cabal-Version: >=1.10 Source-Repository this- Tag: 0.0+ Tag: 0.0.0.1 Type: darcs Location: http://hub.darcs.net/thielema/hackage-processing @@ -34,4 +34,4 @@ Cabal >=1.22 && <2, hackage-db >=1.22 && <1.23, containers >=0.4 && <0.6,- base >=4.5 && <4.9+ base >=4.5 && <4.10
src/Main.hs view
@@ -25,10 +25,14 @@ main = do [person] <- getArgs db <- DB.readHackage- let matching =- Map.mapMaybe+ {- |+ For lazy processing it is important not to flatten the Map with Map.mapMaybe.+ -}+ let scanned =+ Map.map (fmap fst . Map.maxViewWithKey . Map.filter (hasContributor person)) db- Fold.sequence_ $ flip Map.mapWithKey matching $ \pkgName (version, pkg) ->+ Fold.sequence_ $ flip Map.mapWithKey scanned $ \pkgName maybeMatching ->+ Fold.forM_ maybeMatching $ \(version, pkg) -> printf "%s & %s & %s \\\\\n" pkgName (display version) (Pkg.synopsis (Pkg.packageDescription pkg))