@@ -197,8 +197,10 @@ t_Show = show `eq` (show . T.pack)
197197tl_Show = show `eq` (show . TL.pack)
198198t_mappend s = mappend s`eqP` (unpackS . mappend (T.pack s))
199199tl_mappend s = mappend s`eqP` (unpackS . mappend (TL.pack s))
200−t_mconcat = mconcat `eq` (unpackS . mconcat . L.map T.pack)
201−tl_mconcat = mconcat `eq` (unpackS . mconcat . L.map TL.pack)
200+t_mconcat = unsquare $
201+ mconcat `eq` (unpackS . mconcat . L.map T.pack)
202+tl_mconcat = unsquare $
203+ mconcat `eq` (unpackS . mconcat . L.map TL.pack)
202204t_mempty = mempty == (unpackS (mempty :: T.Text))
203205tl_mempty = mempty == (unpackS (mempty :: TL.Text))
204206t_IsString = fromString `eqP` (T.unpack . fromString)
@@ -262,11 +264,14 @@ s_map_s f = map f `eqP` (unpackS . S.unstream . S.map f)
262264sf_map p f = (map f . L.filter p) `eqP` (unpackS . S.map f . S.filter p)
263265t_map f = map f `eqP` (unpackS . T.map f)
264266tl_map f = map f `eqP` (unpackS . TL.map f)
265−s_intercalate c = L.intercalate c `eq`
267+s_intercalate c = unsquare $
268+ L.intercalate c `eq`
266269 (unpackS . S.intercalate (packS c) . map packS)
267−t_intercalate c = L.intercalate c `eq`
270+t_intercalate c = unsquare $
271+ L.intercalate c `eq`
268272 (unpackS . T.intercalate (packS c) . map packS)
269−tl_intercalate c = L.intercalate c `eq`
273+tl_intercalate c = unsquare $
274+ L.intercalate c `eq`
270275 (unpackS . TL.intercalate (TL.pack c) . map TL.pack)
271276s_intersperse c = L.intersperse c `eqP`
272277 (unpackS . S.intersperse c)
@@ -274,10 +279,14 @@ s_intersperse_s c = L.intersperse c `eqP`
274279 (unpackS . S.unstream . S.intersperse c)
275280sf_intersperse p c= (L.intersperse c . L.filter p) `eqP`
276281 (unpackS . S.intersperse c . S.filter p)
277−t_intersperse c = L.intersperse c `eqP` (unpackS . T.intersperse c)
278−tl_intersperse c = L.intersperse c `eqP` (unpackS . TL.intersperse c)
279−t_transpose = L.transpose `eq` (map unpackS . T.transpose . map packS)
280−tl_transpose = L.transpose `eq` (map unpackS . TL.transpose . map TL.pack)
282+t_intersperse c = unsquare $
283+ L.intersperse c `eqP` (unpackS . T.intersperse c)
284+tl_intersperse c = unsquare $
285+ L.intersperse c `eqP` (unpackS . TL.intersperse c)
286+t_transpose = unsquare $
287+ L.transpose `eq` (map unpackS . T.transpose . map packS)
288+tl_transpose = unsquare $
289+ L.transpose `eq` (map unpackS . TL.transpose . map TL.pack)
281290t_reverse = L.reverse `eqP` (unpackS . T.reverse)
282291tl_reverse = L.reverse `eqP` (unpackS . TL.reverse)
283292t_reverse_short n = L.reverse `eqP` (unpackS . S.reverse . shorten n . S.stream)
@@ -374,17 +383,24 @@ sf_foldr p f z = (L.foldr f z . L.filter p) `eqP` (S.foldr f z . S.filter p)
374383 where _types = f :: Char -> Char -> Char
375384t_foldr f z = L.foldr f z `eqP` T.foldr f z
376385 where _types = f :: Char -> Char -> Char
377−tl_foldr f z = L.foldr f z `eqP` TL.foldr f z
386+tl_foldr f z = unsquare $
387+ L.foldr f z `eqP` TL.foldr f z
378388 where _types = f :: Char -> Char -> Char
379−sf_foldr1 p f = (L.foldr1 f . L.filter p) `eqP` (S.foldr1 f . S.filter p)
389+sf_foldr1 p f = unsquare $
390+ (L.foldr1 f . L.filter p) `eqP` (S.foldr1 f . S.filter p)
380391t_foldr1 f = L.foldr1 f `eqP` T.foldr1 f
381−tl_foldr1 f = L.foldr1 f `eqP` TL.foldr1 f
392+tl_foldr1 f = unsquare $
393+ L.foldr1 f `eqP` TL.foldr1 f
382394
383−s_concat_s = L.concat `eq` (unpackS . S.unstream . S.concat . map packS)
384−sf_concat p = (L.concat . map (L.filter p)) `eq`
395+s_concat_s = unsquare $
396+ L.concat `eq` (unpackS . S.unstream . S.concat . map packS)
397+sf_concat p = unsquare $
398+ (L.concat . map (L.filter p)) `eq`
385399 (unpackS . S.concat . map (S.filter p . packS))
386−t_concat = L.concat `eq` (unpackS . T.concat . map packS)
387−tl_concat = L.concat `eq` (unpackS . TL.concat . map TL.pack)
400+t_concat = unsquare $
401+ L.concat `eq` (unpackS . T.concat . map packS)
402+tl_concat = unsquare $
403+ L.concat `eq` (unpackS . TL.concat . map TL.pack)
388404sf_concatMap p f = unsquare $ (L.concatMap f . L.filter p) `eqP`
389405 (unpackS . S.concatMap (packS . f) . S.filter p)
390406t_concatMap f = unsquare $
@@ -540,24 +556,27 @@ tl_groupBy p = L.groupBy p `eqP` (map unpackS . TL.groupBy p)
540556t_inits = L.inits `eqP` (map unpackS . T.inits)
541557tl_inits = L.inits `eqP` (map unpackS . TL.inits)
542558t_tails = L.tails `eqP` (map unpackS . T.tails)
543−tl_tails = L.tails `eqP` (map unpackS . TL.tails)
544−t_findAppendId (NotEmpty s) = unsquare $ \ts ->
559+tl_tails = unsquare $
560+ L.tails `eqP` (map unpackS . TL.tails)
561+t_findAppendId = unsquare $ \(NotEmpty s) ts ->
545562 let t = T.intercalate s ts
546563 in all (==t) $ map (uncurry T.append) (T.breakOnAll s t)
547−tl_findAppendId (NotEmpty s) = unsquare $ \ts ->
564+tl_findAppendId = unsquare $ \(NotEmpty s) ts ->
548565 let t = TL.intercalate s ts
549566 in all (==t) $ map (uncurry TL.append) (TL.breakOnAll s t)
550−t_findContains (NotEmpty s) = all (T.isPrefixOf s . snd) . T.breakOnAll s .
551− T.intercalate s
552−tl_findContains (NotEmpty s) = all (TL.isPrefixOf s . snd) .
567+t_findContains = unsquare $ \(NotEmpty s) ->
568+ all (T.isPrefixOf s . snd) . T.breakOnAll s . T.intercalate s
569+tl_findContains = unsquare $ \(NotEmpty s) -> all (TL.isPrefixOf s . snd) .
553570 TL.breakOnAll s . TL.intercalate s
554571sl_filterCount c = (L.genericLength . L.filter (==c)) `eqP` SL.countChar c
555572t_findCount s = (L.length . T.breakOnAll s) `eq` T.count s
556573tl_findCount s = (L.genericLength . TL.breakOnAll s) `eq` TL.count s
557574
558−t_splitOn_split s = (T.splitOn s `eq` Slow.splitOn s) . T.intercalate s
559−tl_splitOn_split s = ((TL.splitOn (TL.fromStrict s) . TL.fromStrict) `eq`
560− (map TL.fromStrict . T.splitOn s)) . T.intercalate s
575+t_splitOn_split s = unsquare $
576+ (T.splitOn s `eq` Slow.splitOn s) . T.intercalate s
577+tl_splitOn_split s = unsquare $
578+ ((TL.splitOn (TL.fromStrict s) . TL.fromStrict) `eq`
579+ (map TL.fromStrict . T.splitOn s)) . T.intercalate s
561580t_splitOn_i (NotEmpty t) = id `eq` (T.intercalate t . T.splitOn t)
562581tl_splitOn_i (NotEmpty t) = id `eq` (TL.intercalate t . TL.splitOn t)
563582
@@ -599,10 +618,14 @@ t_lines' = lines' `eqP` (map unpackS . T.lines')
599618t_words = L.words `eqP` (map unpackS . T.words)
600619
601620tl_words = L.words `eqP` (map unpackS . TL.words)
602−t_unlines = L.unlines `eq` (unpackS . T.unlines . map packS)
603−tl_unlines = L.unlines `eq` (unpackS . TL.unlines . map packS)
604−t_unwords = L.unwords `eq` (unpackS . T.unwords . map packS)
605−tl_unwords = L.unwords `eq` (unpackS . TL.unwords . map packS)
621+t_unlines = unsquare $
622+ L.unlines `eq` (unpackS . T.unlines . map packS)
623+tl_unlines = unsquare $
624+ L.unlines `eq` (unpackS . TL.unlines . map packS)
625+t_unwords = unsquare $
626+ L.unwords `eq` (unpackS . T.unwords . map packS)
627+tl_unwords = unsquare $
628+ L.unwords `eq` (unpackS . TL.unwords . map packS)
606629
607630s_isPrefixOf s = L.isPrefixOf s `eqP`
608631 (S.isPrefixOf (S.stream $ packS s) . S.stream)
@@ -679,8 +702,9 @@ t_indices (NotEmpty s) = Slow.indices s `eq` indices s
679702tl_indices (NotEmpty s) = lazyIndices s `eq` S.indices s
680703 where lazyIndices ss t = map fromIntegral $ Slow.indices (conc ss) (conc t)
681704 conc = T.concat . TL.toChunks
682−t_indices_occurs (NotEmpty t) ts = let s = T.intercalate t ts
683− in Slow.indices t s == indices t s
705+t_indices_occurs = unsquare $ \(NotEmpty t) ts ->
706+ let s = T.intercalate t ts
707+ in Slow.indices t s == indices t s
684708
685709-- Bit shifts.
686710shiftL w = forAll (choose (0,width-1)) $ \k -> Bits.shiftL w k == U.shiftL w k