Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Haskell in WTFs/minute

Name: Anonymous 2009-02-10 17:34

Name: Anonymous 2009-02-10 18:31

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: Anonymous 2009-02-10 18:31

I don't like people who spend more time blogging about programming than actually programming.

Name: Anonymous 2009-02-10 18:32

WTF?

Name: Anonymous 2009-02-10 18:36

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.

Name: Anonymous 2009-02-10 18:46

C++ is the most expressive language. Haskell just fails.

Name: Anonymous 2009-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.

Name: Anonymous 2009-02-10 20:00

>>2
I lol'd at this.

Also, this man is the Jerry Seinfeld of Haskell.

Name: Anonymous 2009-02-10 20:18

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.

Name: Anonymous 2009-02-10 22:01

who the hell actually reads blogs?
go read a book instead

Name: Anonymous 2009-02-11 0:17

>>2
behaviour

back to Britain, please.

Name: Anonymous 2009-02-11 0:44

Reposting links from Hacker News every day considered a fucking eyesore. Please don't do it!

Name: Anonymous 2009-02-11 0:45

Reposting links from Hacker News every day considered a fucking eyesore. Please don't do it!

Name: Anonymous 2009-02-11 0:45

Reposting links from Hacker News every day considered a fucking eyesore. Please don't do it! ­

Name: 2009-02-11 0:45

Reposting links from Hacker News every day considered a fucking eyesore. Please don't do it! ­

Name: 2009-02-11 0:45

Reposting links from Hacker News every day considered a fucking eyesore. Please don't do it! ­

Name: Anonymous 2009-02-11 0:49

>>16
It was on reddit too.

Name: Anonymous 2009-02-11 0:51

>>8
Did you lol for no reason at all?

Name: Anonymous 2009-02-11 8:27

This is why /prog/ is better than Reddit.

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: Anonymous 2009-02-11 12:52

Dons and I go way back. We used to masturbate together as children.

Name: Anonymous 2009-02-11 15:15

Dons is an awesome fellow. Real gentlemen like.

Name: Anonymous 2009-02-11 17:17

WTF is foldr and zip
oh come on!

Name: Anonymous 2009-02-11 17:34

>>22
the real question is "Why the fuck is there both foldr and foldl?"

Name: Anonymous 2009-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

>>23
Why not? The both have their uses

Name: Anonymous 2009-02-11 17:58

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)

Name: Anonymous 2009-02-11 17:59

>>22
Try foldr on infinite lists.

Name: Anonymous 2009-02-11 18:01

>>25
oops, that should be:
foldl f z a = foldr (flip f) z (reverse a)

Name: Anonymous 2009-02-11 18:11

>>26
Prelude> let f a _ = a
Prelude> foldr f 0 [1..]
1


works fine for me...

Name: Anonymous 2009-02-11 18:49

Prelude> foldr ((:) . (*2)) [] [1..]

>>27
Where's the accompanying linear-time reverse implementation...?

Name: Anonymous 2009-02-11 18:59

>>29
reverse = foldl (flip (:)) []

Name: Anonymous 2009-02-11 19:01

>>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: !HaskeLLJWs 2009-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: Anonymous 2009-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: Anonymous 2009-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.

Name: Anonymous 2009-02-11 21:42

>>34
unsafePerformIO can't buy you happiness.

Name: Anonymous 2009-02-12 4:30

>>35
unsafePerformIO is happiness.

Name: Anonymous 2009-02-12 12:39

Why is foldr better than foldl? To my understanding foldr is recursive and foldl is tail recursive.

Name: Anonymous 2009-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).

Name: Anonymous 2009-02-12 13:14

(SAGE)

Name: Anonymous 2009-02-12 13:39

TAIL RECURSION CONSIDERED IRRELEVANT

Name: Anonymous 2009-02-12 14:33

>>37
No, foldl' is tail recursive. Lazy functions are never tail recursive.

Name: Anonymous 2009-02-12 15:54

>>41
yes they are look: how do you suck so many cocks

Name: Anonymous 2009-02-12 16:18

my other cock is a cdck

Name: Anonymous 2009-02-12 16:31

>>32
your foldl is not a left fold

Name: Anonymous 2009-02-12 19:08

>>44
most people don't ever need a real left fold.

Name: Anonymous 2009-02-12 21:00

But my shirts do

Name: Anonymous 2009-02-12 21:21

>>46
just reverse the shirt and do a right fold instead.

Name: Anonymous 2009-02-12 22:11

>>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.

Name: Anonymous 2009-02-12 22:40

>>48
It's topologically equivalent, so quit your whining.

Name: Anonymous 2009-02-12 23:35

>>29
reverse = foldr (\x y -> y ++ [x]) []

Name: Anonymous 2009-02-13 0:14

>>50
accompanying linear-time reverse implementation
linear-time reverse implementation
linear-time implementation
linear-time

Name: Anonymous 2009-03-06 8:31


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?

Name: Anonymous 2011-01-31 20:11

<-- check em dubz

Don't change these.
Name: Email:
Entire Thread Thread List