
As a replacement, what about:
[ n + 10 | n <- [1..9], odd n ]
Pithy and not equivalent to "id" :P
Tom
El Apr 20, 2015, a las 20:47, Tikhon Jelvis
Are we constraining the examples to not use any external libraries? I can see why that's a good idea, but it also makes it hard to show something both pithy and useful.
On Mon, Apr 20, 2015 at 5:22 PM,
wrote: While we're at it, the "foldr (:) [] [1,2,3]" example probably isn't going to cause anyone to give away their worldly possessions and dedicate their lives to haskell.
Tom
El Apr 20, 2015, a las 18:53, Ertugrul Söylemez
escribió: Hi everybody,
I'd like to note that the prime "sieve" example that is sitting at the top of the homepage is not a real sieve and will more likely make people with number theory experience (like me) feel highly irritated rather than fascinated. A real sieve does not only run a million times (!) faster and consumes far less memory, but is also much longer, even in Haskell. Here is a real one:
I don't want to make a mountain out of a molehill, but please note: If I'd be new to Haskell, that example would have turned me off, because it would have hurt my ability to take Haskell programmers seriously. You can easily promote your tools when you claim that they can build a car easily, except in reality it's just a toy bicycle.
It's the same feeling to cryptographers when people call a regular stream cipher a "one-time pad" and promote it as such. It rings the "this is snake oil!" alarm bell.
So I propose to either rename the 'sieve' function to something more appropriate (like `trialDiv`) or replace the example altogether. I would suggest an example that truly shows Haskell's strengths. Trial division search is really just a bad substitute for the more common and equally inappropriate list quicksort example.
Greets, Ertugrul _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe