2 ms·
show that you are exaggerating a bit No, it merely shows that I don't know Haskell--I didn't claim Haskell couldn't be as concise as Perl for this kind of thin
by SwellJoe 18y ago
show that you are exaggerating a bit
No, it merely shows that I don't know Haskell--I didn't claim Haskell couldn't be as concise as Perl for this kind of thing...just that I don't know how to make it as concise. The link helps very much, thanks. (And, just so no one is misled, the same example could be done as a Perl one-liner, as well, using the magic variables I mentioned in the prior comment. I just figured I'd make it readable, since there are some anti-Perl bigots around just waiting for the chance to say, "I knew it! It's nothing but line noise!".)
Also worth noting...I love that I can write code like the example you've shown in Perl (with some minor syntactic differences, but it does have first class functions and expressions as arguments), and the fact that Haskell seems to be entirely made up of code like that made it seem very appealing on first glance. That slurping a file can be written in Haskell in one line and some lib imports makes me...umm, I'm embarrassed to say...a little giddy. And it makes me wonder why I didn't start using Haskell sooner.