Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.   3 acc f (a, b) x = if f x then (x:a, b)
  3.   4                         else (a, x:b)
  4.   5
  5.   6 splitWith f = foldl (acc f) ([], [])
  6.   7
  7.   8 quickSort [] = []
  8.   9 quickSort (x:xs) = quickSort left ++ [x] ++ quickSort right
  9.  10                 where (left, right) = splitWith (<=x) xs
  10.  11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement