qsortImpl :: (Integral i, Ix i, Ord e, MArray arr e m) => arr i e -> i -> i -> m ()
qsortImpl arr l r = when (r > l) $ do
    let mid = l + (r - l) `div` 2
    nmid <- partition arr l r mid
    withStrategy rpar $ qsortImpl arr l (nmid - 1)
    qsortImpl arr (nmid + 1) r
qsortImpl :: (Integral i, Ix i, Ord e, MArray arr e m) => arr i e -> i -> i -> m ()
qsortImpl arr l r = when (r > l) $ do
    let mid = l + (r - l) `div` 2
    nmid <- partition arr l r mid
    withStrategy rpar $ qsortImpl arr l (nmid - 1)
    qsortImpl arr (nmid + 1) r
qsortImpl arr l r = when (r > l) $ do
    let mid = l + (r - l) `div` 2
    nmid <- partition arr l r mid
    withStrategy rpar $ qsortImpl arr l (nmid - 1)
    qsortImpl arr (nmid + 1) r