A little toy of Haskell Trivia

I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not! Currently it only includes GHC 6.8 core library. If you have any idea how to parse through HackageDB code, please let me know. http://haskell.ecoin.net/cgi-bin/modules.pl Disclaimer: This is entirely for fun. It is by no means accurate or complete. I only spent a couple hours on a little perl script and a mysql table...

Am Mittwoch, 20. Februar 2008 22:22 schrieb Steve Lihn:
I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not!
This doesn’t surprise me very much. What surprises me more is that OpenGL stuff is that popular. :-)
[…]
Best wishes, Wolfgang

On Thu, 21 Feb 2008, Wolfgang Jeltsch wrote:
Am Mittwoch, 20. Februar 2008 22:22 schrieb Steve Lihn:
I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not!
This doesn’t surprise me very much. What surprises me more is that OpenGL stuff is that popular. :-)
Maybe some kind of self-citation ...

Hello Wolfgang, Thursday, February 21, 2008, 2:45:43 AM, you wrote:
I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not!
This doesn’t surprise me very much. What surprises me more is that OpenGL stuff is that popular. :-)
perhaps opengl library just contains too many modules that imports each other :))) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On Feb 21, 2008, at 5:24 , Bulat Ziganshin wrote:
Hello Wolfgang,
Thursday, February 21, 2008, 2:45:43 AM, you wrote:
I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not!
This doesn’t surprise me very much. What surprises me more is that OpenGL stuff is that popular. :-)
perhaps opengl library just contains too many modules that imports each other :)))
I have seen (demo) programs import the OpenGL modules just to get (:=). Wonder if that goes on in the real world? -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On Wed, Feb 20, 2008 at 09:22:58PM +0000, Steve Lihn wrote:
I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not!
Currently it only includes GHC 6.8 core library. If you have any idea how to parse through HackageDB code, please let me know.
The layout is pretty simple. The index file http://hackage.haskell.org/packages/archive/00-index.tar.gz contains all the .cabal files. From their names you can figure out the locations of the source bundles, e.g. AGI/1.1/AGI.cabal -> http://hackage.haskell.org/packages/archive/AGI/1.1/AGI-1.1.tar.gz You can easily slurp the lot. The HackageDB wiki page has more details: http://hackage.haskell.org/trac/hackage/wiki/HackageDB

Rewriting that script in Haskell could be an
interesting exercise. Do you have the source code?
Benjamin L. Russell
--- Steve Lihn
I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not!
Currently it only includes GHC 6.8 core library. If you have any idea how to parse through HackageDB code, please let me know.
http://haskell.ecoin.net/cgi-bin/modules.pl
Disclaimer: This is entirely for fun. It is by no means accurate or complete. I only spent a couple hours on a little perl script and a mysql table... _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Feb 20, 2008 at 09:22:58PM +0000, Steve Lihn wrote:
I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not!
Currently it only includes GHC 6.8 core library. If you have any idea how to parse through HackageDB code, please let me know.
There's a link on the HackageDB Introduction page that gets you the latest versions of all packages (30MB).

There's a link on the HackageDB Introduction page that gets you the latest versions of all packages (30MB).
Ross, Thanks for the archive URL. I parsed through all the hackagedb modules. I also added the display of repository source (ghc, hdb) and package source. HackageDB is 3-4 times bigger than GHC core. The result is interesting, looking at the most used modules move up and down the rank... http://haskell.ecoin.net/cgi-bin/modules.pl As I reflect on what I did, this result is kind of useful in learning Haskell. Haskell is about re-using modules and building on top of them. If a module is often used by Haskell community (especially, library writers), a beginner better understand that module first (such as Monad, List, Map, Exception, Array, etc). On the other hand, I am thinking to display a "eco-system" kind of graph/chart to show how the modules are connected with each other, and which module is on the top of the "eco-system" (either the most advanced module, or a module no one cares about!). But my data seem to have a recursive nature. I don't quite understand why nor how to get by it.
Rewriting that script in Haskell could be an interesting exercise. Do you have the source code?
Ben, I think the best way to write this parser in Haskell is to use haddock since haddock understands Haskell syntax much better than my hacker-style script. Here is the source code of both the parser(s) and cgi script. The code is very experimental and low-quality... Let me know if you have any question. http://haskell.ecoin.net/haskell-trivia.tgz Steve

On Sat, Feb 23, 2008 at 10:59:40AM -0500, Steve Lihn wrote:
I parsed through all the hackagedb modules. I also added the display of repository source (ghc, hdb) and package source. HackageDB is 3-4 times bigger than GHC core. The result is interesting, looking at the most used modules move up and down the rank...
You'd get a different picture again if you excluded same-package imports. Some of the high-ranking modules are used internally in large packages.

Ross,
I changed the query to "count(distinct package)" and indeed the
"noises" of same package imports are filtered out. The two top-10
lists now look somewhat similar.
GHC only: http://haskell.ecoin.net/cgi-bin/modules.pl?src=ghc
1 Control.Monad 22
2 Data.Char 20
3 System.IO 17
4 Data.List 16
5 Data.Maybe 16
6 System.IO.Unsafe 14
7 Control.Exception 13
8 Foreign.Ptr 11
9 Data.Word 11
10 Foreign.C 11
GHC+HackageDB: http://haskell.ecoin.net/cgi-bin/modules.pl?src=both
1 Control.Monad 178
2 Data.List 132
3 Data.Maybe 113
4 Data.Char 104
5 System.IO 99
6 Control.Exception 98
7 Data.Word 83
8 System.IO.Unsafe 81
9 Foreign 74
10 Data.Map 68
Steve
On Sat, Feb 23, 2008 at 5:25 PM, Ross Paterson
On Sat, Feb 23, 2008 at 10:59:40AM -0500, Steve Lihn wrote:
I parsed through all the hackagedb modules. I also added the display of repository source (ghc, hdb) and package source. HackageDB is 3-4 times bigger than GHC core. The result is interesting, looking at the most used modules move up and down the rank...
You'd get a different picture again if you excluded same-package imports. Some of the high-ranking modules are used internally in large packages.
participants (7)
-
Benjamin L. Russell
-
Brandon S. Allbery KF8NH
-
Bulat Ziganshin
-
Henning Thielemann
-
Ross Paterson
-
Steve Lihn
-
Wolfgang Jeltsch