3 ms·
I'm not sure if I'm the first to notice, but the Haskell quicksort function is wrong, because it mishandles NaN: main = let nan = 0.0 / 0.0 in
by ridiculous_fish 13y ago
I'm not sure if I'm the first to notice, but the Haskell quicksort function is wrong, because it mishandles NaN:
main = let nan = 0.0 / 0.0 in
do putStrLn $ show $ quicksort [nan, 1.0, 2.0, 3.0]
putStrLn $ show $ quicksort [1.0, nan]
[NaN]
[1.0]
Sort routines should not return a list of a different length than their input.
- ww520 13y agoElegance tends to be grinded away when the rubber meets the road.