News for hackers. Stuff that matters.
Re:In Praise of Haskell by otikik on Monday November 04, 2013 @12:24PM (#6669806)
Also, after a week I still didn't understand its type system completely.

It may be that I am simply too dumb, or that I didn't find the right resources, but 'easy to learn' this language is not.

Re:In Praise of Haskell by thinkpad20 on Monday November 04, 2013 @01:53PM (#6670377)
Haskell is really not much more strongly typed than Java, or even C++ (although it's much less liberal with letting you cast than either of those languages). Just like those languages, if a function has been declared to use types a, b and c, then you'd better supply types a, b, and c as arguments. This is the same. The only real extension that I can see is the ability to create functions which accept or return arbitrary types, like `foo :: a -> [a]`, which isn't an option in Java or C++ without some hackery. Of course there are type classes and algebraic data types and other things as well, but I don't think they really make the language "more strongly typed," just more expressive in their types.

What makes Haskell a little challenging in the beginning is its currying, which means you don't need to call a function with all of its stated arguments, and the fact that function application associates to the left; i.e. that `f x y` is the same as `(f x) y`, NOT `f (x y)`, which is closer to how it would be in, say, Ruby or CoffeeScript. There are very good reasons for this, but it does take some getting used to. Currying and associativity rules are responsible for a lot of seemingly incomprehensible type errors. You get better at avoiding them as time goes on. I feel that the weirdness of reading Haskell DSLs, like Parsec, which often make heavy use of customized operators, or do-notation, is an extension of these issues, since most of the difficulty comes from trying to figure out how the types propagate through what amounts to be long, complicated chains of function applications.

Re:In Praise of Haskell by carterschonwald on Monday November 04, 2013 @12:27PM (#6669825)
If you're stuck, asking questions on the Haskell irc channel on freenode is a great way to get feedback. Learning new things is a social process, not something to be done in a padded room. :-)
Re:In Praise of Haskell by jroesch on Monday November 04, 2013 @02:24PM (#6670575)
The worst thing to do when learning Haskell is to think that you will be comfortable in just a week. Learning Haskell for most is like relearning to program. It takes time to build up intuition and understanding of the language. I know that it took me multiple tries at Haskell over a few months before it finally "clicked" for me and became comfortable to work in.
Re:In Praise of Haskell by pnathan on Monday November 04, 2013 @12:42PM (#6669946)
The type system is considerably more sophisticated than most languages we're accustomed to.
Re:In Praise of Haskell by tieTYT on Monday November 04, 2013 @01:11PM (#6670120)
The problem is you only waited a week. Haskell is so different from the most popular languages you should approach it like you're learning programming for the first time.
Re:In Praise of Haskell by chongli on Monday November 04, 2013 @01:48PM (#6670334)
Rome wasn't built in a day! Learning a new language in a week is not an easy thing to do. The reason other languages seem a lot easier to learn (Python, Ruby, etc.) is that those languages are all fundamentally similar to one another; Haskell is not.
Re:In Praise of Haskell by platz on Monday November 04, 2013 @12:56PM (#6670023)
I'm learning too. Btw, which resources are you using?