
It seems to me that among the basic concepts to focus on when learning
Haskell are Currying (or partial evaluation), functional composition as a
way to produce another function (and not just as an evaluation strategy),
and passing functions are arguments.
In all three one has to think in terms of functions being values that are
created dynamically and passed around.
A good way to practice is to focus on writing point-free code and to use the
$ syntax notation as much as possible. $ is nice in that it is the apply
function. Thinking of it in those terms helps build intuition since (again)
its first argument is a function that is passed to it.
A nice thing about these concepts is that they all exist and can be played
with at the code level. They can all be explored at the level of the
operational semantics of the language--i.e., how it works when you write
code. Virtually no theory is required to learn or use them.
*
-- Russ*
*
*
On Sat, Dec 18, 2010 at 3:00 AM,
Send Beginners mailing list submissions to beginners@haskell.org
To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-request@haskell.org
You can reach the person managing the list at beginners-owner@haskell.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: How to think in Haskell (David Virebayre) 2. How to think in Haskell (Jun HU) (Sean Charles) 3. Re: How to think in Haskell (Jun HU) (Gregg Reynolds) 4. Re: How to think in Haskell (Ertugrul Soeylemez) 5. Computational Linguistic (Luca Ciciriello) 6. Re: Computational Linguistic (SOLVED) (Luca Ciciriello)
----------------------------------------------------------------------
Message: 1 Date: Fri, 17 Dec 2010 13:10:45 +0100 From: David Virebayre
Subject: Re: [Haskell-beginners] How to think in Haskell To: Brent Yorgey
Cc: beginners@haskell.org Message-ID: Content-Type: text/plain; charset=UTF-8
2010/12/16 Brent Yorgey
: On Thu, Dec 16, 2010 at 04:41:24PM +0100, Luca Ciciriello wrote:
Hi, here my path (in correct order) I followed to learn to think functionally:
1) Curry-Howard Isomorphism 2) Type Theory & Functional Programming 3) The Hindley-Milner Type inference algorithm 4) Basic Category Theory 5) Notions of computation and monads 6) Denotational semantics 7) Monads for functional programming 8) Theorems for free. 9) A History of Haskell: Being Lazy With Class
These are all wonderful topics. ?But I strongly disagree with the notion that one must understand all of these before even starting a Haskell tutorial (!), or even that one must understand all of these to be able to "think functionally" in some sense.
... aaaaand I'm going to agree with Brent here.
It took me a while to have many things "click", but I found it hard to thoroughly read many papers. The mathematical notation which I'm not familiar with often is a problem to stay focused.
What helped for me was reading tutorials and practice. Reading about people's problems on Caf?, and reading the replies. Re-reading several times a tutorial, weeks apart. I wish I had Real world haskell was I was starting, but I have it now and I'm glad I do.
I can't claim I understand more than Haskell 98, but it's more than enough for a start.
David.
------------------------------
Message: 2 Date: Fri, 17 Dec 2010 14:44:09 +0000 From: Sean Charles
Subject: [Haskell-beginners] How to think in Haskell (Jun HU) To: beginners@haskell.org Message-ID: <1292597049.3903.18.camel@sean-desktop> Content-Type: text/plain; charset="UTF-8" I learned Smalltalk in 1999, then I found LISP because Alan Kay said it was the most awesome language ever invented. That got me hooked into using s-expressions for everything!
Then I found Erlang and that was just brilliant, although I still missed the s-expression format of LISP.
Then, about seven months ago I decided to try Haskell, I bought the Real World Haskell book and I've been trying to get better every day I can.
I've been a software develoepr for aobut twenty-six years, from assembly language on chips and DEC/VAX right through to today and without doubt Haskell has been my single most frustrating learning experience ever.
And that my friends is a compliment to Haskell! :)
I am *not* a mathematician, I did 'A'-level maths and physics and computers back when Clive Sinclair was a force to be reckoned with. To be told I have to read a big list of stuff with titles that would make people think I was speaking in tongues doesn't cut it for me. For my day job I *have* to cut PHP/Drupal, so I applied learning Haskell and made myself some tools that generate Drupal code!
Make it relevant to what you do everyday, that way it will carry more meaning for you, why spend hours head-scratching over some fancy pants monadic kung-fu lesson when you can as easily learn to read a file and process each line, do something with it and then create a new file.
First rule of optimisation: Don't do it. It was how I felt learning LISP too, there are so many functions to do things, which is the 'right' one? Make it work first then you can step back and say, "Can I do this more succinctly using more advanced language features?"
Don't try to learn it all at once, it's depressing! I know!
BIG HELP: The single biggest thing that helped me was to download the PDF slide-notes and watch both parts of Simon Peyton Jones talks, all available here: http://notes-on-haskell.blogspot.com/2007/08/more-spj.html
It was when I realises that, unlike C++ for example, where there is an implicit 'this' pointer stuffed in the stack, in Haskell programs there is an implicit pointer to the type information being passed around which made lots of things click for me like "How does it know?" LOL
Haskell is the classic elephant sandwich; a formidable task, but everytime I understand something new it feels great!
Best of luck! :) Sean Charles
------------------------------
Message: 3 Date: Fri, 17 Dec 2010 09:18:42 -0600 From: Gregg Reynolds
Subject: Re: [Haskell-beginners] How to think in Haskell (Jun HU) To: sean@objitsu.com Cc: beginners@haskell.org Message-ID: Content-Type: text/plain; charset="utf-8" On Fri, Dec 17, 2010 at 8:44 AM, Sean Charles
wrote: I've been a software develoepr for aobut twenty-six years, from assembly language on chips and DEC/VAX right through to today and without doubt Haskell has been my single most frustrating learning experience ever.
And that my friends is a compliment to Haskell! :)
Don't try to learn it all at once, it's depressing! I know!
I took my first crack at Haskell 5+ years ago, was befuddled by the term "constructor" and left completely in the dark by monads. So I moved on to other things. It took me about three tries and a lot of research into various corners of computer science (I was a liberal arts major) to reach the point where I understood the terminology and began to grasp the big picture. Fortunately there's a lot more information available for beginners now.
Even though the likelihood of me ever getting paid to program in Haskell is nil, what I've gained from studying it vastly outweighs the considerable effort I put into it. I thought I was learning another programming language; in fact, I was learning to think about computation, logic, and mathematics in ways that were completely new and very enlightening to me. To really really understand it all, you have to delve into lambda calculus most obviously, but also intuitionistic mathematics and logic, proof theory, category theory, and various other fascinating topics. In 100 or even 10 years such stuff will form part of a basic educational program, but at the moment it's like a secret world of magical beasts. The down side is there's nobody to talk to about it (except via mailing lists) since almost nobody outside of specialists even knows this world exists.
BIG HELP: The single biggest thing that helped me was to download the PDF slide-notes and watch both parts of Simon Peyton Jones talks, all available here: http://notes-on-haskell.blogspot.com/2007/08/more-spj.html
" is also very helpful, even if you have no interest in actually implementing functional languages. It (and various other pubs) has proven very helpful in deciphering some of the arcane bits of terminology that often pop up in discussions of Haskell and FP, such as boxing, bottom, "weak head normal
His book "Implementation of Functional Languages< http://research.microsoft.com/en-us/um/people/simonpj/papers/slpj-book-1987/... form", etc. You can skim the gory details and still get a lot out of it. Plus, I just found the tutorial version< http://research.microsoft.com/en-us/um/people/simonpj/papers/pj-lester-book/
.
-Gregg