[Haskell-cafe] Parsing cabal files to calculate average number of dependencies

2011-07-01 Thread Gwern Branwen
Athas on #haskell wondered how many dependencies the average Haskell package had. I commented that it seemed like some fairly simple scripting to find out, and as these things tend to go, I wound up doing a complete solution myself. First, we get most/all of Hackage locally to examine, as tarballs

Re: [Haskell-cafe] Parsing cabal files to calculate average number of dependencies

2011-07-01 Thread Gwern Branwen
On Fri, Jul 1, 2011 at 4:49 PM, L Corbijn wrote: > Is this including or exluding 'or'-ed dependency lists like > http://hackage.haskell.org/package/hugs2yc ? Excluding, it seems. When I run the script on that tarball: $ tar --wildcards "*.cabal" -Oxf `find . -name "*.tar.gz" | g hugs2yc` | runha

Re: [Haskell-cafe] Parsing cabal files to calculate average number of dependencies

2011-07-01 Thread Rogan Creswick
On Fri, Jul 1, 2011 at 1:43 PM, Gwern Branwen wrote: > Athas on #haskell wondered how many dependencies the average Haskell > package had. I commented that it seemed like some fairly simple > scripting to find out, and as these things tend to go, I wound up > doing a complete solution myself. > >

Re: [Haskell-cafe] Parsing cabal files to calculate average number of dependencies

2011-07-01 Thread Gwern Branwen
On Fri, Jul 1, 2011 at 5:23 PM, Rogan Creswick wrote: > > I think the index tarball has all the info you need, and would be > faster to retrieve / process, if you or anyone else needs to get the > .cabal files again: > > http://hackage.haskell.org/packages/archive/00-index.tar.gz (2.2mb) Looking

Re: [Haskell-cafe] Parsing cabal files to calculate average number of dependencies

2011-07-01 Thread Gwern Branwen
Another thing you can do along the same lines is generate a script to download all the repos from packages which declare repos. Some ugly code: import Data.Maybe (fromJust) import Distribution.PackageDescription import Distribution.PackageDescription.Parse import Control.Monad (unless) main :: IO

Re: [Haskell-cafe] Parsing cabal files to calculate average number of dependencies

2011-07-09 Thread Gwern Branwen
On Fri, Jul 1, 2011 at 5:37 PM, Gwern Branwen wrote: > Looking at it, the index tarball contains the .cabal files for all > versions known to Hackage, which isn't necessarily the interesting set > of cabal files - I'm usually more interested in just the cabal files > of the latest version of every

Re: [Haskell-cafe] Parsing cabal files to calculate average number of dependencies

2011-07-19 Thread Henning Thielemann
On 02.07.2011 01:26, Gwern Branwen wrote: Another thing you can do along the same lines is generate a script to download all the repos from packages which declare repos. Some ugly code: If 'script' also includes Haskell code, then the 'tar' package could be of help to walk throught the TAR ar