groupBy' eq (x:xs) = (x:ys) : groupBy' eq zs
  where
    (ys,zs) = partition (eq x) xs
groupBy' eq (x:xs) = (x:ys) : groupBy' eq zs
  where
    (ys,zs) = partition (eq x) xs
groupBy' eq (x:xs) = (x:ys) : groupBy' eq zs
  where
    (ys,zs) = partition (eq x) xs