Need help learning functional programming 
Author Message
 Need help learning functional programming

Hi,
 I've been looking around for a tutorial on functional programming,
but have yet to find one that was easy for me to get into. In
particular, I've found the 'Gentle Introduction to Haskell' to be
anything but.
 What I'm looking for is a sort of high level overview of the
'functional way' for programmers used to more imperative styles of
programming. I can't quite grasp functional concepts, and keep trying
to reduce them to c++ construts, which, of course, they aren't. So, if
someone could direct me to a web page or recommend a good book, I'd be
very grateful.


Thu, 01 Jan 2004 11:52:38 GMT  
 Need help learning functional programming

Quote:
>So, if
>someone could direct me to a web page or recommend a good book, I'd be
>very grateful.

I can recommend "The Craft of Functional Programming" by Simon Thompson
as a very basic, introductory text.

rajat



Thu, 01 Jan 2004 12:38:53 GMT  
 Need help learning functional programming
The following are all about SML;
I'd recommend the Gentle Intro for you (it may be gentler than the
correspondingly-titled Haskell tutorial).

<li> <a href = http://www.cs.cmu.edu/~rwh/introsml/ >
<b>Programming in Standard ML</b>, by Bob Harper</a>
<li> <a href = http://www.dcs.napier.ac.uk/course-notes/sml/manual.html >
<b>A Gentle Introduction to ML</b>, by Andrew Cumming</a>
<li> <a href = http://www.dcs.ed.ac.uk/home/stg/NOTES/ >
<b>Programming in Standard ML '97: An On-line Tutorial</b>,
  by Stephen Gilmore</a>
<li> <a href = http://www.cs.cornell.edu/riccardo/smlnj.html >
<b>Notes on Programming SML/NJ</b>, by Riccardo Pucella</a>

But  if you want to stick with Haskell, then try the
Thompson book (mentioned in another post), note that it is about
Haskell.  In fact I thought it is called "Haskell: The Craft of FP"

Regards,

Jeremy



Thu, 01 Jan 2004 13:33:27 GMT  
 Need help learning functional programming

Quote:
> What I'm looking for is a sort of high level overview of the
>'functional way' for programmers used to more imperative styles of
>programming. I can't quite grasp functional concepts, and keep trying
>to reduce them to c++ construts, which, of course, they aren't. So, if
>someone could direct me to a web page or recommend a good book, I'd be
>very grateful.

Try this:

http://mitpress.mit.edu/sicp/full-text/book/book.html

You'll need a Scheme implementation. This one
will make you quite happy:

http://www.cs.rice.edu/CS/PLT/packages/drscheme/

--
Don't think you are. Know you are.



Thu, 01 Jan 2004 18:26:14 GMT  
 Need help learning functional programming

Hi,

google for "Two dozen short lessons in Haskell", by Rex Page

HTH
jb

--



Fri, 02 Jan 2004 02:14:00 GMT  
 Need help learning functional programming
Hi,

Here you can find an online draft of a book which contains an overview of
many programming paradigms, including functional programming.

It helped me at least to see how you should "think" while programming in a
functional way, and how the same programs could be written using e.g.
declarative, logic, dataflow, imperative, whatever programming.

It doesn't seem to be finished (although it already contains 650+ pages of
material), but seems to be updated regularly.

All programming examples are in the programming language oz, which supports
all paradigms that are discussed.

http://www.info.ucl.ac.be/people/PVR/book.html



Fri, 02 Jan 2004 16:56:00 GMT  
 Need help learning functional programming
I recommend "Functional Programming" by Jeroen Fokker
available here as PDF http://www.cs.ruu.nl/people/jeroen/

-Brian


Quote:
> Hi,
>  I've been looking around for a tutorial on functional programming,
> but have yet to find one that was easy for me to get into. In
> particular, I've found the 'Gentle Introduction to Haskell' to be
> anything but.
>  What I'm looking for is a sort of high level overview of the
> 'functional way' for programmers used to more imperative styles of
> programming. I can't quite grasp functional concepts, and keep trying
> to reduce them to c++ construts, which, of course, they aren't. So, if
> someone could direct me to a web page or recommend a good book, I'd be
> very grateful.



Sat, 03 Jan 2004 01:26:16 GMT  
 Need help learning functional programming
Earlier someone recommended "Structure and Interpretation of Computer Programs";
it's MIT's textbook for their introductory computer science course.  I recently
read about half of it in an idle day, even working through *some* of the
examples, and it held my attention the entire time.

It is indeed one way to look at functional languages, and only in about the
middle of the book do the authors begin introducing state and mutable data
members (on their way to constructing an object-oriented system through Scheme's
basic functionality!), and discussing the troubles they bring.

This is valuable, valuable stuff.  I will say that some aspects of "popular"
pure functional languages (such as, say, strong typing and type inference--and I
haven't seen much discussion of currying functions, which can be fun) don't
really get much attention here, but other aspects (functional composition, the
ability to treat functions as data and pass them to and fro) are very valuable.

And as mentioned earlier, the text is available free on the web (curse, swear...
I bought a paper copy before discovering this--heh).

I wish something like this had been my introduction to programming instead of me
learning C from whatever materials were available.  It can be pretty
mind-bending stuff.

(but even after SICP, I just can't love LISP/Scheme despite its obvious power.
Sigh.  Too many parentheses and not enough typechecking.  But that's a personal
preference rather than a real argument).

-->VPutz



Sun, 11 Jan 2004 07:02:16 GMT  
 Need help learning functional programming

Quote:

> (but even after SICP, I just can't love LISP/Scheme despite its obvious power.
> Sigh.  Too many parentheses and not enough typechecking.

At least Common Lisp can give you as much typechecking as you
like. Now if you do not like the braces check out Dylan, somehow a
Lisp with "traditional" notation

Regards
Friedrich



Sun, 11 Jan 2004 13:46:08 GMT  
 Need help learning functional programming

Quote:


>> (but even after SICP, I just can't love LISP/Scheme despite its obvious
>> power. Sigh.  Too many parentheses and not enough typechecking.
> At least Common Lisp can give you as much typechecking as you like.

Sure, at runtime. If you mean compile time, a rather doubtful claim...

Regards,
Markus Mottl

--



Sun, 11 Jan 2004 19:18:32 GMT  
 Need help learning functional programming

Quote:



> >> (but even after SICP, I just can't love LISP/Scheme despite its obvious
> >> power. Sigh.  Too many parentheses and not enough typechecking.

> > At least Common Lisp can give you as much typechecking as you like.

> Sure, at runtime. If you mean compile time, a rather doubtful
>claim...

That is not fully the case, you are right in a way that no Lisp is
enforced to declarations but it seems that at least the commercial
offerings and CMUCL honor them and generate different code for it. I
do not want to enter a discussion about the merits of static
typechecking here, just wanted to point out that typechecking isn't a
good reason to refuse at least Common Lisp.

Regards
Friedrich



Sun, 11 Jan 2004 20:21:23 GMT  
 Need help learning functional programming

Quote:



>> > At least Common Lisp can give you as much typechecking as you like.

>> Sure, at runtime. If you mean compile time, a rather doubtful
>>claim...
> That is not fully the case, you are right in a way that no Lisp is
> enforced to declarations but it seems that at least the commercial
> offerings and CMUCL honor them and generate different code for it. I
> do not want to enter a discussion about the merits of static
> typechecking here, just wanted to point out that typechecking isn't a
> good reason to refuse at least Common Lisp.

You are changing the argument, this wasn't your claim (read it again
above). Adding _some_ static typechecking is not difficult, but "as much
typechecking as you like" is clearly an exaggeration. Lisp and cohorts
are not designed to support this generality. This has nothing to do with
"honoring declarations", which I have not mentioned anywhere at all.

Also don't misquote me: I have not started any discussion about the
merits of static typechecking, but have only refused your claim in its
generality irrespective of its consequences, be they good or bad.

Regards,
Markus Mottl

--



Sun, 11 Jan 2004 21:49:57 GMT  
 Need help learning functional programming

Quote:




> > >> (but even after SICP, I just can't love LISP/Scheme despite its obvious
> > >> power. Sigh.  Too many parentheses and not enough typechecking.

> > > At least Common Lisp can give you as much typechecking as you like.

> > Sure, at runtime. If you mean compile time, a rather doubtful
> >claim...
> That is not fully the case, you are right in a way that no Lisp is
> enforced to declarations but it seems that at least the commercial
> offerings and CMUCL honor them and generate different code for it. I
> do not want to enter a discussion about the merits of static
> typechecking here, just wanted to point out that typechecking isn't a
> good reason to refuse at least Common Lisp.

You are confusing type declarations and static type checking.  Often they
go hand in hand, but neither actually requires the other.  In many
dynamically typed languages, type declarations are used to speed up your
program (tell the compiler that it does not need to care about certain types
at certain program points).  In many implementations, these declarations are
actually not fully checked and, thus, are not safe ("trust the programmer" mode).
In many statically type languages, type declarations are given to the compiler
so it can statically verify them. Some of these compilers might even produce
better code when handed the right declarations.  Some statically typed languages
require few type declarations (although they typically permit them).  In such
languages, the compiler infers the static types and verifies them at the same time.
Type declarations are a means of documentation and also a way of asserting
more restrictive type constraints (constraint which go beyond what the
program at hand actually requires to be safe).  With some compilers,
type declarations of this kind can also lead to better code.

Matthias



Sun, 11 Jan 2004 22:01:12 GMT  
 Need help learning functional programming
You both are rigth

Regards
Friedrich



Sun, 11 Jan 2004 23:26:55 GMT  
 
 [ 18 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Learning Functional Programming

2. Learning a functional programming language

3. functional.py 0.6 - Functional Programming in Python

4. functional.py 0.7 - Functional programming in Python

5. functional.py - functional programming in Python

6. functional.py 0.7 - Functional programming in Python

7. functional.py 0.6 - Functional Programming in Python

8. functional.py - functional programming in Python

9. Need hlp on learning PM programming

10. Need hlp on learning PM programming

11. Need Web Sites: Machine Learning Programs written in C or C++

12. Learn to write your own Homepages, or learn to program (On Line)

 

 
Powered by phpBB® Forum Software