qs :: Ord a => [a] -> [a] qs = \case [] -> [] (x : (partition (< x) -> (qs -> as, qs -> bs))) -> as <> [x] <> bs