So, this works in Haskell
1
Name:
Anonymous
2008-02-18 5:34
replaceMin :: Tree Int -> Tree Int
replaceMin t = let (t', m) = rpMin (t, m) in t'
rpMin :: (Tree Int, Int) -> (Tree Int, Int)
rpMin (Leaf a, m) = (Leaf m, a)
rpMin (Branch l r, m) = let (l', ml) = rpMin (l, m)
(r', mr) = rpMin (r, m)
in (Branch l' r', ml `min` mr)
And replaces every Leaf in the tree with the minimum value in the tree. All in one pass.
What other Voodoo magic can that dog do?
2
Name:
Anonymous
2008-02-18 5:36
3
Name:
Anonymous
2008-02-18 5:48
>>2
The dog that had no pancreas.
How did he secrete digestive enzymes?
Terrible!
4
Name:
Anonymous
2008-02-18 6:01
>>2
It's actually a retarded cat.
5
Name:
Anonymous
2008-02-18 6:01
My dog understands English.
How did he react when I told him all these jokes?
Terrible!
6
Name:
Anonymous
2008-02-18 7:20
>>1
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
7
Name:
Anonymous
2008-02-18 7:27
fibs = 0 : 1 : [(a + b) | (a, b) <- zip fibs (tail fibs)]
8
Name:
Anonymous
2008-02-18 7:30
9
Name:
Anonymous
2008-02-18 7:42
Done anyone have the photos of Haskell the Dog?
10
Name:
Anonymous
2008-02-18 7:54
11
Name:
Anonymous
2008-02-18 8:09
My dog has no vocal chords.
How does he pronounce cdr ?
Terrible.
12
Name:
Anonymous
2008-02-18 9:20
Question: How do I make line numbers appear in EMACS, not on the mode line, but at the beginning of each line?
13
Name:
Anonymous
2008-02-18 9:34
14
Name:
Anonymous
2008-02-18 9:37
15
Name:
Anonymous
2008-02-18 9:49
>>13
LOOK AT FAGGOT VIMMER
16
Name:
Anonymous
2008-02-18 10:43
17
Name:
Anonymous
2008-02-18 11:00
VIMMER
18
Name:
Anonymous
2008-02-18 11:10
Happy Vimming!
19
Name:
Anonymous
2008-02-18 11:34
20
Name:
Anonymous
2008-02-18 11:41
>>19
Nope, that's what I use, shows line numbers on the mode line.
21
Name:
Anonymous
2008-02-18 17:29
>>1
lol "All in one pass"
22
Name:
Anonymous
2008-02-18 17:42
My dog has no fingers.
How does he type ESCAPE-META-ALT-CONTROL-SHIFT ?
Terrible !
23
Name:
Anonymous
2008-02-18 20:11
24
Name:
Anonymous
2008-02-18 20:48
25
Name:
Anonymous
2008-02-18 21:25
26
Name:
Anonymous
2008-02-18 23:13
CDR IS MY OTHER CAR
27
Name:
Anonymous
2008-02-19 0:39
(define car cdr)
28
Name:
Anonymous
2008-02-19 1:30
>>27
WHAT HAS SCIENCE DONE
?!!!?
29
Name:
Anonymous
2008-02-19 2:59
>>28
Please optimise with interrobangs.
30
Name:
Anonymous
2008-02-19 6:27
>>29
WHAT HAS SCIENCE DONE
‽!‽
31
Name:
Anonymous
2009-08-17 0:49
Lain.