News for hackers. Stuff that matters.
Re:Haskell: The Confusing Parts by jimbokun on Monday October 05, 2009 @12:46PM (#862117)
"Lisp is known for hating infix notation, but Haskell embraces it. ... There are ten levels of operator precedence (0 through 9)"

This is one of the things I prefer about Lisp. Am I the only one who still has to stop and think occasionally about what binds more tightly with what when reading and writing code in languages with many precedence levels? Never a problem in a Lisp.

Re:Haskell: The Confusing Parts by shrughes on Monday October 05, 2009 @01:26PM (#862195)
I haven't noticed it being a problem in Haskell. Most of Haskell's weird operators are either uncommon enough so that everybody uses parentheses with them (such as bitwise (.|.) and (.&.) and so on), common enough that you don't forget (but (&&) and (||) are the two I always forget, and occasionally some people don't use parentheses with them), or weird and common but it's very hard to use them incorrectly without getting a compile error ((.) and ($) and (>>=) and (<$>) and (<*>) and (++) and (:) and (&&&) and so on). I don't think most of the operators in the last list would be usable without static type checking.

In particular, operators like ($) and (.) are hugely beneficial and the latter's existence is one of the main reasons people like Haskell's syntax.

Re:Haskell: The Confusing Parts by tel on Monday October 05, 2009 @01:07PM (#862151)
I appreciate both, honestly. Lisp achieves a great deal through purity of syntax, but that sort of thing was never Haskell's goal. Personally, I almost never think about how precedences compare; instead you learn a Haskell coding style that support the syntactic tricks allowed by operator precedence. A pretty common one goes something like this:

  forM [1..] $ \n -> do
    a <- monadicAction1 n
    b <- monadicAction2 a
    return b
Which is sort of ugly from a Lisp point of view, but I think it's a great trick enabled by having $ be an ultra-low precedence sequencing combinator. It looks like a Ruby block almost, but has zero extra syntax and very clear semantics.
Re:Haskell: The Confusing Parts by enum on Monday October 05, 2009 @10:44AM (#861874)
Misses laziness, which is arguably the most confusing part.
Re:Haskell: The Confusing Parts by neonscribe on Monday October 05, 2009 @10:13AM (#861814)
This page immediately crashes Firefox 3.5.3 on Snow Leopard!
Re:Haskell: The Confusing Parts by petercooper on Monday October 05, 2009 @10:24AM (#861838)
Ditto. Like, immediately and hard.

I had a look at the source in Safari and there's little contentious on there. No JavaScript, Flash, or whatever. The only oddity is some horrifically formatted HTML with the end of tags coming on the next line every time - could merely that be killing FF though?

Re:Haskell: The Confusing Parts by mncaudill on Monday October 05, 2009 @10:28AM (#861847)
Checks out fine with 3.5.3 on WinXP, but I'd point the finger at that poorly-formatted HTML.
Re:Haskell: The Confusing Parts by mattyb on Monday October 05, 2009 @10:46AM (#861878)
Also works fine with 3.5.3 on Ubuntu 9.04.
Re:Haskell: The Confusing Parts by PoisonInkwell on Monday October 05, 2009 @01:25PM (#862193)
The HTML is autogenerated by my Markdown program. Sorry it looks weird. Anyway, the CSS (in particular, the use of the Hoefler Text font) is what brings Gecko to its knees.
Re:Haskell: The Confusing Parts by petercooper on Monday October 05, 2009 @03:06PM (#862495)
Really? That's weird. I've used Hoefler Text in mockups before (though ultimately decided against it). Useful to know though!
Re:Haskell: The Confusing Parts by telemachos on Monday October 05, 2009 @02:17PM (#862365)
Using Pandoc like a good Haskell user, eh?
Re:Haskell: The Confusing Parts by jbalogh on Monday October 05, 2009 @12:35PM (#862087)
Re:Haskell: The Confusing Parts by joevandyk on Monday October 05, 2009 @10:44AM (#861873)
Same here. Pretty big bug. Had to load up Safari.

Someone report the bug, I'm too lazy.

Re:Haskell: The Confusing Parts by diiq on Monday October 05, 2009 @11:59AM (#862032)
The article itself was perhaps a little disappointing --- it mostly discussed syntax rather than semantics that I find confusing. It did link to http://blog.sigfpe.com/2006/08/you-could-have-invented-monad..., though, and I am finding that very enlightening.
Re:Haskell: The Confusing Parts by jriddycuz on Monday October 05, 2009 @06:00PM (#862917)
I still find the most confusing aspect of Haskell to be that it makes me feel like I have to think like a mathematician rather than a programmer.
Re:Haskell: The Confusing Parts by joevandyk on Monday October 05, 2009 @10:46AM (#861879)
not sure why this is here, it's not really worth reading yet.
Re:Haskell: The Confusing Parts by steveklabnik on Monday October 05, 2009 @11:39AM (#861985)
As he says in the first part, feel free to discuss what parts of Haskell are confusing to _you_, and then it can be made by the community, rather than just by him.
Re:Haskell: The Confusing Parts by adharmad on Monday October 05, 2009 @10:53AM (#861888)
Also does not tackle monads.
Re:Haskell: The Confusing Parts by jrockway on Monday October 05, 2009 @04:05PM (#862646)
Monads are nothing special. "They" somehow acquired some stigma of being "difficult", which caused people to write tutorials to help others understand them. Then the proliferation of tutorials led people to believe that they are difficult to understand, which caused people to write more tutorials. And here we are today, where people avoid a programming language because they think there is some incredibly hard concept they have to master but will never be smart enough to understand.

Anyway, the Typeclassopedia is recommended reading: http://www.haskell.org/haskellwiki/Typeclassopedia

Once you understand the relationship between functions, applicative functors, monads, and arrows, everything will make sense -- they are all the same thing.

(The next issue is, "why would I want this kind of abstraction", but that's best for you to decide on your own.)

Re:Haskell: The Confusing Parts by maxtilford on Monday October 05, 2009 @11:07AM (#861917)
I don't believe tutorials are the right way to figure out monads. For one thing, they aren't as extremely important as they're made out to be, people have just latched on to the name. If you really want to understand monads you have to actually try to write code using them, and struggle through it.
Re:Haskell: The Confusing Parts by barrkel on Monday October 05, 2009 @11:39AM (#861983)
I understand monads just fine. I would like to see a readable explanation of the exact syntactic transformation of the 'do' notation to the actual function that the monad is to logically return the wrapped application of.
Re:Haskell: The Confusing Parts by maxtilford on Monday October 05, 2009 @12:14PM (#862055)
If I'm reading that right, you want to see how do-notation is desugared? The best explanation I could find was http://metafoo.co.uk/practical-monads.txt The two sections "Binding lines together" and "Lines that don't return values" explain it nicely.
Re:Haskell: The Confusing Parts by PoisonInkwell on Monday October 05, 2009 @01:21PM (#862179)
Deliberately. Please note the links to two existing (and very good) monad tutorials... The last thing the Haskell community needs is another lackluster one.
Re:Haskell: The Confusing Parts by johnwatson11218 on Monday October 05, 2009 @07:30PM (#863090)
I had one semester of Haskell in school and thought I knew a thing or two about it. The last thing I attempted in Haskell was the game of blackjack. The two big problems there were user input, and the random numbers that were used to shuffle the deck of cards. Very quickly I had to combine two monads in my code to get anything going and I found it very confusing. It seemed like my entire program had become tainted with the non functional aspects. The tutorials didn't really clear things up either, I'm trying Scala now and that at least seems like it will let me pull in the functional pieces where I can use them.