[Haskell-cafe] Is Excel the most used -- and fucntional -- programming lanuage on Earth?

Lennart Augustsson lennart at augustsson.net
Wed Jan 31 04:22:14 EST 2007

I think you're using a somewhat non-standard definition of function.
Say that I have the Haskell expression
   let x = 5
       y = x + 2
       z = x * y
Would you call y and z functions?  I wouldn't, I would call them
definitions with free variables in the rhs.

But that's beside the point.  When you ask what you could do with
functions in Excel do you mean from a practical or theoretical
 From a practical perspective I'd say the difference is immense.
In Excel today, if you want to do, e.g., a map you do it by copying
a formula.  So any change in that formula needs N changes in the
spreadsheet.  With functions, you could do the change in one place.
Furthermore, if you add some kind of lists/arrays (which Excel sort
of has), you can express things in a much easier way.
At work we have added a way to define functions in Excel.  It's quite
clunky since you have to shoehorn it into Excel, but even so it's been
quite popular and change the way people use Excel.

 From a theoretical perspective, it would increase the class of problems
expressible in Excel.  I'm not sure if these complexity classes have any
names, though.  Assuming unit time for the basic Excel functions (+,  
-, etc),
today you can only express formulas that take at most linear time, in  
size of the formula, to calculate.  With functions, this would  
increase to
at least exponential (at least that's my gut reaction).

	-- Lennart

On Jan 30, 2007, at 23:59 , Dan Piponi wrote:

> On 1/30/07, Lennart Augustsson <lennart at augustsson.net> wrote:
>> Excel is what I like to call a 0:th order functional language,
>> i.e., you can't even define functions, just values.  :)
> Every cell with an expression in Excel is a function. The problem is
> that the domains and codomains of these functions don't usually
> contain functions. Maybe that makes it a first order functional
> language.
> But...suppose we had a spreadsheet a little like Haskell where each
> cell has a static type, and the values can be Haskell functions. What
> interesting things could we do with it that we couldn't do with Excel?
> --
> Dan

More information about the Haskell-Cafe mailing list