Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree, but I'd go even further: make the example in the corner actually tryable the "Try It" section.

For this example:

  primes = sieve [2..]
      where sieve (p:xs) = 
        p : sieve [x | x <- xs, x `mod` p /= 0]
I tried to type it into the shell:

  λ primes = sieve [2..]
  <hint>:1:8: parse error on input `='
It doesn't work. Okay, what if I copy and paste?

  λ primes = sieve [2..] where sieve (p:xs) = p : sieve [x | x <- xs, x `mod` p /= 0]
  <hint>:1:8: parse error on input `='
Doesn't work.

Now, I know enough about Haskell to know what I can and can't type into ghci, but what about people who are encountering Haskell for the first time? They'll try to run the given example in the "Try It" section and will get nothing but errors. Just my two cents.

P.S. Is Haskell still avoiding success at all costs? (A philosophy I continue to be okay with, but it seems to getting futile :) )



Haskell is still avoiding (success at all costs), the bracketing is very important. Haskell may seem like a slow to develop language and community at times, but this is because most users want to see well thought out solutions to problems, and if they have theoretical backgrounds showing that what they're doing is a good idea, even better.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: