[Haskell-cafe] main features of functional programming paradigm

Greg Woodhouse gregory.woodhouse at sbcglobal.net
Mon Feb 6 18:53:07 EST 2006

--- Abigail <asho19 at yahoo.com> wrote:

> Hi,
> I would like to ask about what are tha main features
> of functional programming?

Caveat: I'm a relative newcomer to functional programming myself,
certainly not an expert.

There's the obvious definition: Functional programming is writing
programs in the form of functions that are evaluated, as opposed to
procedures that are evaluated.  but even if it's tecnically correct,
I'm not that such a distinction helps very much. I know it uses Scheme
(a variety of Lisp) rather than Haskell, but ch. 3 of "The Structure
and Interpretation of Programming Languages" (SICP) has a nice
treatment of mutable data structures on the one hand, and delayed
evaluation on the other. It's interesting because it gives some insight
into the complementary nature of the approach taken by pure languages
like Haskell (called streams in SICP), and non-functional techniques
such as assignment.

I like to think of this as a kind of time/space duality. If you think
about the sequence of "events" during a computation, then you are
squarely on the side of time, and your computational model is decidely
imperative. If you're willing to let go a bit of time, and instead
start thinking about comprehensions and (potentially) infinite lists,
then you've moved over into the space camp, and your programming style
becomes more functional. 

Gregory Woodhouse  <gregory.woodhouse at sbcglobal.net>
"All truth passes through three stages: First, it is ridiculed.
Second, it is violently opposed. Third, it is accepted as
being self-evident."
--Arthur Schopenhauer

More information about the Haskell-Cafe mailing list