I've the below code snippet in Haskell to implement the quicksort algorithm.
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smaller = quicksort [a | a <- xs, a <= x]
bigger = quicksort [a | a <- xs, a > x]
in smaller ++ [x] ++ bigger
However, GHCi rejects the program telling me that line 5 has a syntax error. But I've checked the Haskell syntax for the "let" keyword and it seems OK.
Is there anyone who can help me with this problem? Thanks a lot.