[Haskell-cafe] Re: Why?
dev at mobileink.com
Thu Dec 10 13:36:58 EST 2009
On Thu, Dec 10, 2009 at 11:16 AM, John D. Earle <JohnDEarle at cox.net> wrote:
> Dear Gregg,
> You wrote, "Just think about how one reads a mathematical text - you need
> not actually compute subformulae or even analyze them logically in order to
> work with them." I hate to have to say this, but do you realize that algebra
> is concerned with functions among other things and it is the fact that these
> expressions are functions and not that they are algebraic that gives them
> this property?
I'd say algebra is mostly concerned with equalities and substitutions and
doesn't much care about functions. The equation for a circle is not a
function but that doesn't mean we can't use algebra to manipulate it.
Algebras might use the concept of function but they are not necessarily
_about_ functions. One could even argue that the lambda calculus isn't
"about" functions - it's just a calculus, after all. Haskell goes by the
rules of that calculus; whether the expressions involved denote functions is
not relevant. The computer is just performs symbol calculus. Generally all
formal semantics can be reduced to syntactic calculus as far as I can see.
> Functional programming is not a misnomer. It is called functional
> programming because you are quite literally working with functions.
Except when you're not. IO operations are never functions, for example, so
IO expressions never denote functions. FP languages do not (and cannot)
eliminate the side effectful nature of such operations; the best they can do
is what Haskell does, namely circumscribe them so that they are well-behaved
and thus can be properly managed (algebraically). But that doesn't make
them functions. So for me at least "algebraic" better describes how Haskell
works; what you're working with is expressions and you reason about them
algebraically. You can do this reliably not because everything is a
function but because non-functions are well-behaved.
> Functions have a profound simplifying effect.
No argument there. But the expressive power that comes with first-class
functions is not what distinguishes Haskell et al. - lots of non-FP
languages support them these days.
> The truth is as Haskell has demonstrated that much of the complexity in
> computer programming is artificial and doesn't need to be there. It makes
> having to prove correctness a lot easier, but that is not the only
> motivation behind Haskell and other functional programming languages. The
> push has been getting performance up to a point where the language may be
> regarded as respectable.
Sure, but that's only possible because the properties of programs are
provable, which is what makes it possible to reliably transform a program
into an equivalent but more efficient form.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe