Re: [Haskell-cafe] RE: Haskell as a first language?

2009-11-07 Thread J.N. Oliveira

Duncan Coutts wrote:


On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote:
 


Charles,

Haskell is a wonderful language (my favorite language by far) but it is 
pretty difficult for a beginner.  In fact, it is pretty difficult for 
anyone to learn in my experience, because it has so many advanced 
concepts that simply don't exist in other languages, and trying to 
absorb them all at once will likely be overwhelming.
   



As a contrary data-point, at Oxford we teach functional programming
(using Haskell) as the first course at the very beginning of the
computer science degree. I know several other universities also use FP
and Haskell very early on in their CS courses.

At Minho we've been using Haskell as first programming course in CS 
degrees since 1997-98. Such a 'functional first' approach is the natural 
way to start a background on programming. Look at the hardware side, for 
instance: which of the following kinds of digital system is taught 
first: combinatorial (eg. nand, nor gates) or sequential (eg. 
flip-flops)? The first, of course, because such circuits are functional 
(no state, no feedback).


More recently I had a go at teaching Haskell to beginners in a non CS 
context (to arts students studying musicology, actually). If you are 
interested, have a look at the slides available from the course's URL:


   www.di.uminho.pt/~jno/html/ipm.html#sec:mp

(Under Acrobat some scores will start playing music once you click the 
pin symbol on the  right.)


All comments, suggestions etc are welcome.

jno
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-16 Thread Christopher Done
I believe that from Scheme to Haskell is a natural transition, as I
made the same transition myself. If you grasp the fundamental concepts
of Scheme, Haskell seems like a step up. I will describe Haskell in
terms of Scheme:

# Haskell programs are more correct from the ground up

Scheme will let you write (+ 2 2) and only tell you that it's wrong
when it tries to run it (You can't add a number and a string!),
whereas Haskell won't even let you run it until the types are correct.
What some find difficult is ``1'' has type Num a = a, which means
for all types a that are Numbers, a (or just all Number types),
e.g. Integer, Double, Rational, etc. But this concept is found Scheme
-- in Scheme you have all sorts of number types; ``+'' means add two
numbers. In Haskell, we specify that notion explicitly.

# Haskell is half wordy as Scheme

Indeed, that is what drew me to Haskell away from Scheme.

## Problem 1

Consider the problem ``Double all the numbers in a list. In Scheme we
might solve this problem like so:

(map (lambda (n) (* n 2)) '(1 2 3 4)

and the result would be (2 4 6).

In Haskell, we can write the same:

map (\n - n * 2) [1,2,3,4]

and the result would be [2,4,6].

But we take it one step further:

map (*2) [1,2,3,4]

This means the same as the previous Haskell example. But the formal
parameter ``x'' has been tripped away because it is redundant.

## Problem 2

Another problem, ``Given a list of lists, reverse all the lists and
double each number in them.'' So in Scheme, we might solve this like
so:

(map (lambda (list)
   (reverse (map (lambda (n) (* n 2)) list)))
 '(1 2 3 4 5))

In Haskell, the same solution is rendered thusly:

map (reverse . map (*2)) [1,2,3,4]

The ``foo . bar'' is equivalent to (\x - foo (bar x)), or, in Scheme
(lambda (x) (foo (bar x))). It's just that we have stripped the
redundant formal parameters.

## Problem 3

Suppose our problem is ``Multiply the first three items of a list''.
Our Scheme solution might be:

(define (first-three-sum list) (* (car list) (cadr list) (caddr list)))

In Haskell, we may write (admittedly, a better way to render this
might be: firstThreeSum = sum . take 3):

firstThreeSum (x:y:z:_) = x * y * z

Here I have demonstrated pattern matching, a powerful and oft-used
feature of Haskell for deconstructing a data structure, like a list or
a tuple, based on a pattern.

I'll abruptly stop here before I write a whole article. I'll summarize
by saying that Haskell is the next step, a natural progression where
things that you know all too well from Scheme become easier, and
safer. The stuff described here is just the tip of the ice burg, of
course. I wish that I had learned Haskell as my first programming
language! Haskell takes a lot of effort to learn, but gives back in
equal amounts. It is a rough ride to learn any programming language.
If you think otherwise, you are not learning, or are learning wrongly.

2009/7/14 Simon Peyton-Jones simo...@microsoft.com

 Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
 Cafe which is read by many people better qualified to answer your question 
 than me.   (Since I've been working on Haskell for many years, I am not well 
 qualified to say how it seems to a beginner.)

 S

 | -Original Message-
 | From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
 | Sent: 11 July 2009 22:52
 | To: Simon Peyton-Jones
 | Subject: Haskell as a first language?
 |
 | I'll make this short! Do you think Haskell is a good language to start
 | with? I am brand new to programming and have been using Scheme, some of
 | my peers suggest I should use Haskell. It seems professional to me.
 | Has features that a beginner should not worry about. What would you
 | suggest. (I'm not worried about bias)
 |
 | Thank you very much for your time.
 |
 | Charles Turner.

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-16 Thread Daniel van den Eijkel

In an ideal world, Haskell would be a perfect first programming language.

But consider: If someone without any programming background learns 
Haskell as first language, she or he might have big problems using any 
other language after that. Unlearning what you can do with Haskell is 
much harder than unlearning imperative thinking. (I had to learn PHP 
after I was used to write in Haskell, and it was no fun) I don't want to 
miss the great experience of learning Haskell *after* Scheme (and Scheme 
after C), and I would not like to deprieve anybody of such an 
experience. Or what should they have for dessert?


I don't know if that's a good argument.

Best regards,
Daniel
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-16 Thread Don Stewart
dvde:
 In an ideal world, Haskell would be a perfect first programming language.

 But consider: If someone without any programming background learns  
 Haskell as first language, she or he might have big problems using any  
 other language after that. Unlearning what you can do with Haskell is  
 much harder than unlearning imperative thinking. (I had to learn PHP  
 after I was used to write in Haskell, and it was no fun) I don't want to  
 miss the great experience of learning Haskell *after* Scheme (and Scheme  
 after C), and I would not like to deprieve anybody of such an  
 experience. Or what should they have for dessert?

FWIW, thousands of students from UNSW in Sydney learned Haskell as their
first language throughout the 90s, before taking courses in C, Java,
some scripting languages etc.

Doesn't seem to have done any harm :) And you come away with a deeper
appreciation of data structures and types.

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-16 Thread Christopher Done
2009/7/16 Daniel van den Eijkel d...@gmx.net:
 In an ideal world, Haskell would be a perfect first programming language.

 But consider: If someone without any programming background learns Haskell
 as first language, she or he might have big problems using any other
 language after that. Unlearning what you can do with Haskell is much harder
 than unlearning imperative thinking. (I had to learn PHP after I was used to
 write in Haskell, and it was no fun) I don't want to miss the great
 experience of learning Haskell *after* Scheme (and Scheme after C), and I
 would not like to deprieve anybody of such an experience. Or what should
 they have for dessert?

I think the transition from one paradigm to another is always hard,
whatever the direction. That's why it's a paradigm.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Simon Peyton-Jones
Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start
| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| 
| Thank you very much for your time.
| 
| Charles Turner.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Andrew Butterfield

Simon Peyton-Jones wrote:

Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
  
The biggest probelm with full Haskell for beginners is that many type 
error messages require

some familiarity with the class system, which is not a beginner topic..

However, a good starting point perhaps is Helium - a stripped down 
version of Haskell
designed for teaching, with special care gvien to producing useful 
helpful error messages...


http://www.cs.uu.nl/wiki/Helium

Then full Haskell could be introduced in semester 2/ year2 / whatever 
timeline suits


(Anything is better than Java.. sigh ;-)
| 
| Thank you very much for your time.
| 
| Charles Turner.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
  



--

Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
Foundations and Methods Research Group Director.
School of Computer Science and Statistics,
Room F.13, O'Reilly Institute, Trinity College, University of Dublin
   http://www.cs.tcd.ie/Andrew.Butterfield/


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Joe Fredette
If only for the fact that our little Haskell community is composed of 
about the nicest set of people ever -- I mean, try asking a newbie 
question on #c sometime -- then Haskell is a great language to learn early.


Not only is it great because of it's community, but it's also full of 
resources -- there are plenty of fun and interesting tutorials to learn 
with, among the best are Real World Haskell -- it's actually a print 
book, but you can read it in it's entirety online, give it a google. 
There's also a nice tutorial called, Learn you a Haskell for Great 
Good (or something like that), I've heard good things about it.


By far the best things you can do are subscribe to the Haskell-Cafe 
mailing list, and get yourself in the #haskell chatroom on freenode. I 
believe it was Mrs. Frizzle who said it best, Ask Questions, Make 
Mistakes, get Haskell-y!!!


/Joe

Simon Peyton-Jones wrote:

Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| 
| Thank you very much for your time.
| 
| Charles Turner.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

  
begin:vcard
fn:Joseph Fredette
n:Fredette;Joseph
adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America
email;internet:jfred...@gmail.com
tel;home:1-508-966-9889
tel;cell:1-508-254-9901
x-mozilla-html:FALSE
url:lowlymath.net, humbuggery.net
version:2.1
end:vcard

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Michael Vanier

Simon Peyton-Jones wrote:

Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| 
| Thank you very much for your time.
| 
| Charles Turner.


  

Charles,

Haskell is a wonderful language (my favorite language by far) but it is 
pretty difficult for a beginner.  In fact, it is pretty difficult for 
anyone to learn in my experience, because it has so many advanced 
concepts that simply don't exist in other languages, and trying to 
absorb them all at once will likely be overwhelming.  My path into 
Haskell was roughly C - Python - Scheme - Ocaml - Haskell, and I 
think that this has a lot going for it (though for a beginner I would 
recommend Python over Haskell, and Scheme is suitable for beginners with 
the right textbooks, e.g. How To Design Programs and/or Structure and 
Interpretation of Computer Programs).  If you're willing to work really 
hard, and don't mind that it may take you quite a bit longer before you 
are creating real applications in Haskell than it would in e.g. Python, 
you can start with Haskell (check out the book Real World Haskell: 
http://realworldhaskell.org).  But if you get frustrated, feel free to 
shift down the list I gave.  Scheme or Ocaml are good languages to learn 
the basics of functional programming, and then you just have to add on 
the Haskell-specific material (of which there is a lot).  Haskell is 
kind of like a point in the language space that programmers evolve towards.


Mike


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Miguel Mitrofanov
I disagree. It was easy enough for me. OK, I do have some Category 
Theory background and it certainly helps a lot. Still, I think that for 
a beginner (without any experience with C or anything like that) Haskell 
would be relatively easy. It doesn't involve (at least at the start) an 
ugly notion of assignment.


Michael Vanier wrote:

Simon Peyton-Jones wrote:
Haskell is a great language!  Check out haskell.org.   I'm ccing the 
Haskell Cafe which is read by many people better qualified to answer 
your question than me.   (Since I've been working on Haskell for many 
years, I am not well qualified to say how it seems to a beginner.)


S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| | I'll make this short! Do you think Haskell is a good language to 
start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| | Thank you very much for your time.
| | Charles Turner.

  

Charles,

Haskell is a wonderful language (my favorite language by far) but it is 
pretty difficult for a beginner.  In fact, it is pretty difficult for 
anyone to learn in my experience, because it has so many advanced 
concepts that simply don't exist in other languages, and trying to 
absorb them all at once will likely be overwhelming.  My path into 
Haskell was roughly C - Python - Scheme - Ocaml - Haskell, and I 
think that this has a lot going for it (though for a beginner I would 
recommend Python over Haskell, and Scheme is suitable for beginners with 
the right textbooks, e.g. How To Design Programs and/or Structure and 
Interpretation of Computer Programs).  If you're willing to work really 
hard, and don't mind that it may take you quite a bit longer before you 
are creating real applications in Haskell than it would in e.g. Python, 
you can start with Haskell (check out the book Real World Haskell: 
http://realworldhaskell.org).  But if you get frustrated, feel free to 
shift down the list I gave.  Scheme or Ocaml are good languages to learn 
the basics of functional programming, and then you just have to add on 
the Haskell-specific material (of which there is a lot).  Haskell is 
kind of like a point in the language space that programmers evolve towards.


Mike


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Bulat Ziganshin
Hello Michael,

Tuesday, July 14, 2009, 2:01:44 PM, you wrote:

 Haskell is a wonderful language (my favorite language by far) but it is
 pretty difficult for a beginner.

i believe that Haskell is hard for intermediate programmers already
knowing any imperative language, but for beginners it should be ideal


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Duncan Coutts
On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote:

 Charles,
 
 Haskell is a wonderful language (my favorite language by far) but it is 
 pretty difficult for a beginner.  In fact, it is pretty difficult for 
 anyone to learn in my experience, because it has so many advanced 
 concepts that simply don't exist in other languages, and trying to 
 absorb them all at once will likely be overwhelming.

As a contrary data-point, at Oxford we teach functional programming
(using Haskell) as the first course at the very beginning of the
computer science degree. I know several other universities also use FP
and Haskell very early on in their CS courses. On the Oxford course
about half the students have had significant previous programming
experience. There does not appear to be a significant difference in how
quickly students with little previous programming experience learn FP
compared to those with more programming experience (keep in mind these
are young people, not mature students with years of professional
programming experience).

The point is, it's not at all clear that it's a harder language for
beginners. Unfortunately, it rather hard to gather decent evidence about
learning on which one could base decisions on the choice of language.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Ross Mellgren
I agree -- I think the most major learning curve problem (for me) was  
not learning haskell directly, it was un-learning all those patterns  
and workarounds and so on from imperative/OOP languages.


Of course, the only problem with learning haskell first is that one  
will probably be mildly annoyed by most of the more common programming  
languages ;-)


-Ross


On Jul 14, 2009, at 6:22 AM, Bulat Ziganshin wrote:


Hello Michael,

Tuesday, July 14, 2009, 2:01:44 PM, you wrote:

Haskell is a wonderful language (my favorite language by far) but  
it is

pretty difficult for a beginner.


i believe that Haskell is hard for intermediate programmers already
knowing any imperative language, but for beginners it should be ideal


--
Best regards,
Bulatmailto:bulat.zigans...@gmail.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Thomas Davie


On 14 Jul 2009, at 13:48, Duncan Coutts wrote:


On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote:


Charles,

Haskell is a wonderful language (my favorite language by far) but  
it is

pretty difficult for a beginner.  In fact, it is pretty difficult for
anyone to learn in my experience, because it has so many advanced
concepts that simply don't exist in other languages, and trying to
absorb them all at once will likely be overwhelming.


As a contrary data-point, at Oxford we teach functional programming
(using Haskell) as the first course at the very beginning of the
computer science degree. I know several other universities also use FP
and Haskell very early on in their CS courses. On the Oxford course
about half the students have had significant previous programming
experience. There does not appear to be a significant difference in  
how

quickly students with little previous programming experience learn FP
compared to those with more programming experience (keep in mind these
are young people, not mature students with years of professional
programming experience).

The point is, it's not at all clear that it's a harder language for
beginners. Unfortunately, it rather hard to gather decent evidence  
about

learning on which one could base decisions on the choice of language.


What I'd be interested to see is how fast beginners pick up haskell  
compared to imperative language – is it actually hard to learn, or do  
we just forget how hard it was to learn a new paradigm when we first  
learned imperative programming.  I guess it's rather hard to establish  
a metric for how fast the learning occurs though.


Bob___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Jake McArthur

Michael Vanier wrote:
Haskell is a wonderful language (my favorite language by far) but it is 
pretty difficult for a beginner.  In fact, it is pretty difficult for 
anyone to learn in my experience, because it has so many advanced 
concepts that simply don't exist in other languages, and trying to 
absorb them all at once will likely be overwhelming.


I disagree, based on seeing my wife learn some Haskell with basically no 
previous experience programming. It was thrilling to see her learn some 
concepts almost instantly that it actually took me a while to understand 
because I had preconceived notions of how programming should work. When 
I talk about how other programming languages do things she thinks it's 
stupid. For example, I mentioned that you can actually change the values 
of variables in most other programming languages, and often have to, and 
she asked how anything understandable gets written that way. I also 
noticed that when I kept emphasizing that you can pass functions as 
parameters to other functions she was getting bored; it seemed that it 
simply would not have made sense any other way. I see no reason why 
learning more concepts on top of this foundation should be all that hard 
for her.


- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Jeremy Shaw
At Tue, 14 Jul 2009 03:01:44 -0700,
Michael Vanier wrote:

 Haskell is a wonderful language (my favorite language by far) but it is 
 pretty difficult for a beginner.  In fact, it is pretty difficult for 
 anyone to learn in my experience, because it has so many advanced 
 concepts that simply don't exist in other languages, and trying to 
 absorb them all at once will likely be overwhelming.

I think that all programming languages are hard to learn, because it
involves a new way of thinking.

It maybe be that Haskell is harder to learn as your *second* language
because you have to unlearn things. Especially if your first language
was something like C or Python.

Additionally, I suspect people forget how hard it was to learn their
first language. They get used to the idea that if they know Python,
they can learn Ruby with out to much difficulty. But that is only
because Python and Ruby share a lot in common. When moving from Python
to Haskell, there is simply more to learn (and unlearn). But, if you
start by knowing nothing, then it is not clear that you have to learn
more to learn Haskell than you would some other language.

Also, Haskell may be easier to learn because it's concepts are more
'pricipled' and 'sensible'. Imperative languages tend to allow all
sorts of silly errors. For example, letting you use unitialized
variables (nearly impossible to do in Haskell). And automatic type
casting has burned me so many times. (Especially automatic conversion
between floating ponit numbers and integers.) I seldom get off-by-one
errors in Haskell, but I do get them in imperative/OOP languages.

I suspect that if you don't know any language and want to become a
Haskell expert as quickly as possible, then the quickest, straigtest
path is to start with Haskell.

Also, it depends on what you mean by 'learn' and 'Haskell'. Just as a
beginning C++ programmer is not going to learn about templates on day
one, a beginner Haskell programmer probably won't be learning type
families on day one.

Additionally, Haskell includes numerous libraries which are not part
of the language itself. Things like parser combinators, pretty
printing, applicative functors, etc, are all just libraries. But each
of those libraries brings a bunch of new concepts. 

- jeremy
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haskell as a first language?

2009-07-14 Thread Ahn, Ki Yung
Before teaching any data structure course, one MUST learn functional 
languages with ADTs.  It makes everything so easy to understand.  So, it 
MUST be a first language in every institution.


The biggest reason that one should learn functional languages with 
algebraic data type(ADT)s first is because understanding recursive 
definitions.  If you recursion first, understanding iteration and 
mutable data structures are dead simple and easy: they are just 
alternate representation or optimization.


However, when you learn while loops and for loops first, your brain gets 
damaged and a lot of students gets stuck when they first see the Tower 
of Hanoi, the notorious in-place quicksort routine written in imperative 
languages, you'll get to think of recursion as some stack blowing up 
monster that must be unrolled and managed manually.  Furthermore, 
learning data structures in most traditional imperative language 
literature gives you the impression that linked list and binary trees 
are brain-fucking spaghetti monsters of memory pointers all the cells, 
which is a dead simple recursive definition in functional languages with 
ADTs.


Personally, I never really understood what linked list was before I 
learned ML and Haskell, although I've used doubly linked list in a C++ 
standard library, which was to me a black box that meets the 
specification in some huge standard document, for two years.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Matthias Görgens
 It maybe be that Haskell is harder to learn as your *second* language
 because you have to unlearn things. Especially if your first language
 was something like C or Python.

Python is not too bad.  You can nearly use it a as a strict functional
programming language.  While this is not the idiomatic style to use
python in, it sure eases transition to a real functional language
(compared to say, C).  Also Python has no pointers, but does have
garbage collection.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe