a very Haskell like qsort