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

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!"



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

> * what zipWith does

haskell:

  zipWith f xs ys
ruby:

  xs.lazy.zip(ys).map(&f)
While Ruby doesn't have a method of the same name, its not exactly foreign.

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

Again, sure, Haskell has different syntax than ruby, but the parens signal something special is going on here.

> * cons syntax for 1 : 1 : ...

Sure, but if you know what the Fibonacci sequence is -- and the reason it and primes are almost without exception the two things chosen for these infinite stream examples in every language is because its presumed that programmers do, its pretty easy to get the idea of what is being done from knowing what the function is trying to do and looking at the values presented.

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

A Rubyist that has no knowledge of laziness isn't a very knowledgable Rubyist, since laziness is an important and central concept in Ruby's Enumerable module (one of the core modules most frequently used by Rubyists.)




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

Search: