I don't know, is the author desperately trying to alienate Haskell to be cool? Dude, you're not cool because you don't understand something. :: is not always used for scoping, Sepples kiddie. It's like saying "wtf C has some kind of weird lists like x[i]. WTF? Oh wait, that's actual C syntax that happens to use the square brackets to index arrays and not denote lists. How quaint."
That man's mentally challenged. Furthermore, his behaviour enrages me.
Name:
Anonymous2009-02-10 18:31
I don't like people who spend more time blogging about programming than actually programming.
That man's mentally challenged. Furthermore, his behaviour enrages me.
This. It's one thing to find some aspects about Haskell confusing, but calling different syntax a "WTF" is just plain retarded.
C++ is the most expressive language. Haskell just fails.
Name:
Anonymous2009-02-10 19:46
>I blog as Art Vandalay for the following reasons: 1. less chance of readers prejudging the value of my opinions based on who I am, 2. greater freedom to say whatever I like without fear of it affecting my employment (but I acknowledge that no one can be purely anonymous on the usual Web), 3. I just want to separate my online persona from the "real" me.
I troll as FrozenVoid for the following reasons: 1. less chance of readers prejudging the value of my opinions based on who I am, 2. greater freedom to say whatever I like without fear of it affecting my employment (but I acknowledge that no one can be purely anonymous on the usual Web), 3. I just want to separate my online persona from the "real" me.
submitted on 10 Feb 2009 points 107 up votes 204 down votes 97
And fuck dons for thinking it was clever enough to submit. The fact that dons is a moron is the main reason I refuse to use xmonad.
Name:
Anonymous2009-02-11 12:52
Dons and I go way back. We used to masturbate together as children.
>>22
the real question is "Why the fuck is there both foldr and foldl?"
Name:
Anonymous2009-02-11 17:37
>>22
Yeah, I stopped reading not long after that. If he wants to be a complete retard and then tell the world, he can, but I wasn't going to read anymore of that bullshit
Why not? The both have their uses
foldr is almost always better than foldl.
and foldl is trivial to implement in terms of foldr: foldl f x a = foldr (flip x) (reverse a)
>>25 foldr is not suitable for everything because of its laziness, but foldl should pretty much never be used. When you want a left fold, use foldl' from Data.List.
Name:
!HaskeLLJWs2009-02-11 19:07
>>27
this would work just fine for most cases where people use foldl: foldl f z a = foldr (flip f) z a
Name:
Anonymous2009-02-11 19:15
>>30 Accompanying. Meaning that your reverse implementation uses only the foldl you provided (and in this case it doesn't, since it seems corecursion doesn't work in this case). Unless you're saying that you can implement foldl using foldl...?
Name:
Anonymous2009-02-11 20:36
>>33 Unless you're saying that you can implement foldl using foldl...?
I can, given enough unsafePerformIO. You can do anything with that shit.
Why is foldr better than foldl? To my understanding foldr is recursive and foldl is tail recursive.
Name:
Anonymous2009-02-12 12:55
>>37 17:49 <You> > foldr f z [1..7]
17:49 <lambdabot> f 1 (f 2 (f 3 (f 4 (f 5 (f 6 (f 7 z))))))
17:49 <You> > foldl f z [1..7]
17:49 <lambdabot> f (f (f (f (f (f (f z 1) 2) 3) 4) 5) 6) 7
Notice the 1) 2) 3) 4) 5) 6) 7. Then notice how the value of 2 isn't actually needed until the final invocation (f z 1) finishes. Then think of the laziness and all the thunks that would pile up. foldl' is stricter and doesn't have this problem (or, not as bad, anyway, but that's outside the scope of this post).
>>47
No way. I want the front part to remain in the front after folding. If I do it your way, the shirt will feature the back part of the shirt which is not what I want.
The GNU Java compiler can compile Java to machine language It simplified things by giving us forced indentation of code learn to get to that function before I posted it Even w o parens maybe im over thinking it so 15 was serious i think all of that is beyond me IHBT?