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

ITT we conjure the spirits with our dog

Name: Anonymous 2008-10-11 10:39

mymap :: ( a -> b ) -> [a] -> [b]
mymap fn [] = []
mymap fn list = (fn (head list)) : (mymap fn (tail list))


qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)


Holy Sussman I can see FOREVER

Name: Anonymous 2008-10-11 11:26

>>1
Why do you use pattern matching in your qsort but not the map?

mymap _ []     = []
mymap f (x:xs) = f x : mymap f xs

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