2 ms·
Haskell has a `let ... in` syntax. Quoting from (1): quicksort1 :: (Ord a) => [a] -> [a] quicksort1 [] = [] quicksort1 (x:xs) = let smallerSo
by harporoeder 6y ago
Haskell has a `let ... in` syntax. Quoting from (1):
quicksort1 :: (Ord a) => [a] -> [a]
quicksort1 [] = []
quicksort1 (x:xs) =
let smallerSorted = quicksort1 [a | a <- xs, a <= x]
biggerSorted = quicksort1 [a | a <- xs, a > x]
in smallerSorted ++ [x] ++ biggerSorted
1: http://learnyouahaskell.com/recursion http://learnyouahaskell.com/recursion