@@ -578,7 +578,8 @@ transformCombineOpsOrdered constr desc eq t = do
578 transform (dropWhile (> 0)) t (S.dropWhile (> 0))
578 transform (dropWhile (> 0)) t (S.dropWhile (> 0))
579 prop (desc <> " scan") $ transform (scanl' (+) 0) t (S.scanl' (+) 0)
579 prop (desc <> " scan") $ transform (scanl' (+) 0) t (S.scanl' (+) 0)
581− -- XXX add uniq
581+ prop (desc <> " uniq") $ transform referenceUniq t S.uniq
582 prop (desc <> " deleteBy (<=) 0") $
583 prop (desc <> " deleteBy (<=) 0") $
583 transform (deleteBy (<=) 0) t (S.deleteBy (<=) 0)
584 transform (deleteBy (<=) 0) t (S.deleteBy (<=) 0)
@@ -617,10 +618,23 @@ wrapOutOfBounds f i x | null x = Nothing
617 | otherwise = Just (f x i)
618 | otherwise = Just (f x i)
619wrapThe :: Eq a => [a] -> Maybe a
620wrapThe :: Eq a => [a] -> Maybe a
620−wrapThe (x:xs) | all (x ==) xs = Just x
622+ | all (x ==) xs = Just x
621− | otherwise = Nothing
623+ | otherwise = Nothing
622wrapThe [] = Nothing
624wrapThe [] = Nothing
626+-- This is the reference uniq implementation to compare uniq against,
627+-- we can use uniq from vector package, but for now this should
629+referenceUniq :: Eq a => [a] -> [a]
635+ | x == y = go (x : xs)
636+ | otherwise = x : go (y : xs)
624eliminationOps
638eliminationOps
625 :: ([Int] -> t IO Int)
639 :: ([Int] -> t IO Int)
626 -> String
640 -> String