Live data from Hacker News

The New Haskell Homepage

new-www.haskell.org

191–200 of 258 posts

Re: The New Haskell Homepage

#191
post #94

Well, it sure looks nicer, I'll give you that. I'm more interested in the content, though. I was just trying here and there over the last week or so to learn some Haskell - people always seem to be raving about how cool it is. I found my way to the CIS 194 class link, the first one on the page, and I find that it really isn't very good for learning. I went through the first page, trying to run some of the stuff. I fi…

I too dislike tutorials focused around the REPL, because it's rarely how you write code in practice. The REPL is more of a debugging tool for quickly testing and manipulating code you've already written. I'd jump directly into creating code files/modules - begin by creating simple programs using `main` as you would in other languages. Create a file with ".hs" extension, (Haskell filenames start with capital letters b…

Thanks for the help, though Vim is already my choice for insanely-powerful text editor with 2k+ page user manual :) I tried emacs, but the dependence on the control key for everything makes it kinda painful on every keyboard I have. I suppose I could probably remap a bunch of keys or something, but Vim seems to work much better in the default configuration. I know this tends to be a big flamewar subject, so it is what it is.

Anyways, your Hello World and runhaskell are much more along the lines of what I'm looking for. Also checking out the other people's suggested Learn you a Haskell.

Re: The New Haskell Homepage

#192
post #94

Well, it sure looks nicer, I'll give you that. I'm more interested in the content, though. I was just trying here and there over the last week or so to learn some Haskell - people always seem to be raving about how cool it is. I found my way to the CIS 194 class link, the first one on the page, and I find that it really isn't very good for learning. I went through the first page, trying to run some of the stuff. I fi…

I suggest you enable the `+m` flag for multiline input This way, you don't have to use the weird curly braces trick (which I always forget), at the cost of having to type one more enter when entering a oneliner FYI, this is my ghci.conf: https://github.com/berdario/dotfiles/blob/master/ghci.conf (I don't suggest a new user to use ClassyPrelude) That said, I'm not sure what learning material to suggest to you, but if…

I've found that, when it comes to learning a new language from scratch, google and stackoverflow just aren't very helpful. Once you have the basics down, they're good for picking up extra bits and pieces, but at the beginning, when you have no idea where to even start, I find I need something a little more organized.

I will try out that stuff for ghci.conf, though.

Re: The New Haskell Homepage

#193
post #94

Well, it sure looks nicer, I'll give you that. I'm more interested in the content, though. I was just trying here and there over the last week or so to learn some Haskell - people always seem to be raving about how cool it is. I found my way to the CIS 194 class link, the first one on the page, and I find that it really isn't very good for learning. I went through the first page, trying to run some of the stuff. I fi…

I've been reading "Learn You a Haskell for Great Good" and it has been going much more smoothly than it has apparently been going for you. It addresses pretty much all of your complaints. http://learnyouahaskell.com/

Thanks, I'll check that out!

Re: The New Haskell Homepage

#194
The site feels too flashy, and the giant photo feels distracting. It would be nice if it felt "cleaner." As it is, I feel like a newcomer would find it somewhat overwhelming visually.

I think something nice and simple like Rust's homepage[1] would be nice. Or maybe something like Racket's homepage[2].

[1] http://www.rust-lang.org/ [2] http://racket-lang.org/

Re: The New Haskell Homepage

#195

I get paid to write C++ code. I'm pretty good at it. I understand it's normal usage syntax very well. I don't fucking know what a god damn thing means in Haskell. λ 5 + 7 12 :: Num a => a What the christ? The 12 I get. Got it. The colons? Not sure. I think it's just a dumb separator. Num is type! What the hell is a => a? I have no idea. In the top they have an example. primes = sieve[2..] where sieve (p:xs) = p : sie…

Ok I'll take a stab at a super high level crash course: A note! Haskell has weird syntax. But it actually uses this syntax in cool ways, as opposed to some languages that have weird syntax in an effort to be different. Let's consider the basic unit of Haskell programming -- the function! Here is a function which returns its input: f x = x Notice that there are no parens or types or anything. Since functions are used…

Thank you a lot. It was useful grok me some Haskell.

Re: The New Haskell Homepage

#196

Earlier quoted context omitted.

Fibonacci sounds perfect! fibonacci :: Integer -> Integer fibonacci 0 = 0 fibonacci 1 = 1 fibonacci n = fibonacci (n - 1) + fibonacci (n - 2) Arguments for this: * "Find the Nth Fibonacci Number" is among the most universally known programming tasks, so visitors are far more likely to immediately pick up the example than they are with sieve. * It shows off a bit of Haskell syntax that (A) can be learned just by looki…

That's a horrible algorithm though, it takes exponential time. Any good implementation of Fibonacci numbers would be logarithmic in the number of arithmetic operations and polynomial in overall running time (because the numbers get bigger). Here's a good implementation in Haskell: http://nayuki.eigenstate.org/res/fast-fibonacci-algorithms/f... , and the same in Python: http://nayuki.eigenstate.org/res/fast-fibonacci-…

Remember, the target audience is newcomers to Haskell. The purpose of a code sample is to give them a glimpse into the syntax of the language, which should be understandable enough that it piques their interest to learn more.

It would be to the detriment of haskell.org to showcase a superior algorithm that is harder for newcomers to follow.

Re: The New Haskell Homepage

#197

Earlier quoted context omitted.

Fibonacci sounds perfect! fibonacci :: Integer -> Integer fibonacci 0 = 0 fibonacci 1 = 1 fibonacci n = fibonacci (n - 1) + fibonacci (n - 2) Arguments for this: * "Find the Nth Fibonacci Number" is among the most universally known programming tasks, so visitors are far more likely to immediately pick up the example than they are with sieve. * It shows off a bit of Haskell syntax that (A) can be learned just by looki…

That's a horrible algorithm though, it takes exponential time. Any good implementation of Fibonacci numbers would be logarithmic in the number of arithmetic operations and polynomial in overall running time (because the numbers get bigger). Here's a good implementation in Haskell: http://nayuki.eigenstate.org/res/fast-fibonacci-algorithms/f... , and the same in Python: http://nayuki.eigenstate.org/res/fast-fibonacci-…

[deleted]

Re: The New Haskell Homepage

#198
post #183

Earlier quoted context omitted.

Fibonacci sounds perfect! fibonacci :: Integer -> Integer fibonacci 0 = 0 fibonacci 1 = 1 fibonacci n = fibonacci (n - 1) + fibonacci (n - 2) Arguments for this: * "Find the Nth Fibonacci Number" is among the most universally known programming tasks, so visitors are far more likely to immediately pick up the example than they are with sieve. * It shows off a bit of Haskell syntax that (A) can be learned just by looki…

Your example doesnt highlight lazyness like the sieve one does. I would expect to see something like this instead: fibonacci :: [Integer] fibonacci = 1 : 1 : zipWith (+) fibonacci (tail fibonacci)

True, but remember that, say, a Rubyist arriving at haskell.org has no knowledge of:

* what zipWith does

* that (+) is a function being passed, not an operator being invoked

* cons syntax for 1 : 1 : ...

* how this could terminate (having no preexisting knowledge of laziness, remember)

A better goal than "show off all the features of Haskell" is "show a Haskell example that's understandable, demonstrates a clear benefit, and makes you want to learn more."

If a newcomer encounters so much unfamiliar territory that Haskell comes across as too alien to be useful, that only reinforces existing negative stereotypes about it.

Better to give a first impression of "you absolutely can pick up Haskell, and it'll be nice!"

Re: The New Haskell Homepage

#199

> How often do programs crash because of an unexpected null value? Haskell programs never do! > head [] error "Prelude.head: empty list" Ok, so you don't call it `null`, but it still crashes the program. Its deceptive to claim null isn't present because it's conventional to avoid using "error" in favor of Maybe, but it's still there, and used throughout Prelude. The REPL on the site hides these errors too, which is g…

There's a difference between crashing and returning null. If head returned null on an empty list, that null could be passed around to different places in the program before it crashed from a null pointer exception. There can be unexpected crashes in Haskell, but not because of null.

It's not equivalent to null, but analagous to it. With lazy evaluation, I can pass also around the expression `head []` to different places, and it won't complain until I attempt to evaluate it - much like a language with null won't complain until you try to dereference it. Sure there's a difference though - you can see immediately where the problem is with Haskell's error, but it's more difficult to trace why a value might be null in imperative code (Which I think has more to do with mutability than the presence of null).

I was also highlighting that the tryhaskell REPL actually behaves like null, because it doesn't terminate immediately as you would expect.

Just yesterday I was discussing this topic with the author of the Mars language, because his record implementation is equivalent to Haskell's and is flawed in the same way (sum types + records leading to what is effectively the equivalent of `null`) [https://news.ycombinator.com/item?id=8005116]. Given a new language like Mars, he could provide a fix, but we have too much baggage to break Haskell's implementation.

Re: The New Haskell Homepage

#200
Just a nitpick: Why don't you stay consistent and use Open Sans for all the main text and the logotype at the top. Having "Haskell" in Ubuntu when the rest of the site is not stylized like that looks a little silly.
Post reply on HN