[Haskell-cafe] Most used functions in hackage

Rustom Mody rustompmody at gmail.com
Fri Feb 1 16:00:18 CET 2013


On Tue, Jan 29, 2013 at 1:53 PM, Casey Basichis <caseybasichis at gmail.com>wrote:

> Hi Dmitry,
>
> Thanks for the links.  I've been through the 24 Days of Hackage, but I
> think its time to run through them again now that I'm a little more
> familiar with everything.
>
> Why do you think browsing function by function is a bad idea?  It seems
> that knowing exactly what the most used functions are would be an extremely
> effective way of finding both which parts of the Prelude and Hackage are
> most broadly useful (instead of browsing them like a phonebook) and also
> finding support from the community as the most commonly used functions
> would likely be the easiest to find support for.
>
>
Find out "the most used functions" seems to be eminently desirable.
To do that we need to count function-uses.
And to do that we need to know what to count.

Do we?

If you remember, the cost-centre mode of counting functions in haskell
programs was precisely because the usual (first-order language) mode of
counting would lead to the strange conclusion that map and foldr were the
most used and therefore most inefficient functions in Haskell! So a new way
of counting had to be devised.

There is a book: Mathsemantics by Edward Macneal which deals with things
like:
How does an airline count the number of passengers. I quote from the book:

I 1980 I was one passenger, ten passengers, eighteen passengers, thirty-six
> passengers, forty-two passengers, fifty-five passengers, seventy-two
> passengers and ninety-four passengers.  Each of these statements is true.
>

He then goes on to explain.

I was one passenger in the sense that I was a person who traveled by air in
> that year.
> I was eighteen passengers in the sense that I made eighteen round trips.
> I was forty-two passengers in the sense that on forty-two different
> occasions I entered and exited the system of a different carrier.
> I was seventy-two passengers in the sense that on seventy-two occasions I
> was on board an aircraft when it took off from one place and landed at
> another.
> I was ninety-four passengers in the sense that I made ninety-four separate
> entrances and exits from airport terminal buildings.
>

[He missed the explanation for 10!]

He goes on to say that these differences are not mere technicalities and
its important to get the sense of 'passenger'

So… like 'passenger', how many meanings does 'function-use' have?

Rusi
-- 
http://www.the-magus.in
http://blog.languager.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130201/f10fdf1f/attachment.htm>


More information about the Haskell-Cafe mailing list