@@ -535,14 +535,20 @@ noMatch = do
535 d <- suchThat char (/= c)
535 d <- suchThat char (/= c)
536 return (c,d)
536 return (c,d)
537t_takeWhile p = L.takeWhile p `eqP` (unpackS . T.takeWhile p)
537t_takeWhile p = L.takeWhile p `eqP` (unpackS . T.takeWhile p)
539+ = T.null $ T.takeWhile (==c) (T.replicate n (T.singleton c))
538tl_takeWhile p = L.takeWhile p `eqP` (unpackS . TL.takeWhile p)
540tl_takeWhile p = L.takeWhile p `eqP` (unpackS . TL.takeWhile p)
541+tl_takeWhile_null n c
543+ TL.takeWhile (==c) (TL.replicate n (TL.singleton c))
539t_takeWhileEnd p = (L.reverse . L.takeWhile p . L.reverse) `eqP`
544t_takeWhileEnd p = (L.reverse . L.takeWhile p . L.reverse) `eqP`
540 (unpackS . T.takeWhileEnd p)
545 (unpackS . T.takeWhileEnd p)
541−t_takeWhileEnd_null n = forAll noMatch $ \(c,d) -> T.null $
546+t_takeWhileEnd_null t = forAll noMatch $ \(c,d) -> T.null $
542− T.takeWhileEnd (==d) (T.replicate n (T.singleton c))
547+ T.takeWhileEnd (==d) (T.snoc t c)
543tl_takeWhileEnd p = (L.reverse . L.takeWhile p . L.reverse) `eqP`
548tl_takeWhileEnd p = (L.reverse . L.takeWhile p . L.reverse) `eqP`
544 (unpackS . TL.takeWhileEnd p)
549 (unpackS . TL.takeWhileEnd p)
550+tl_takeWhileEnd_null t = forAll noMatch $ \(c,d) -> TL.null $
545− TL.takeWhileEnd (==d) (TL.replicate n (TL.singleton c))
551+ TL.takeWhileEnd (==d) (TL.snoc t c)
546s_dropWhile p = L.dropWhile p `eqP` (unpackS . S.dropWhile p)
552s_dropWhile p = L.dropWhile p `eqP` (unpackS . S.dropWhile p)
547s_dropWhile_s p = L.dropWhile p `eqP` (unpackS . S.unstream . S.dropWhile p)
553s_dropWhile_s p = L.dropWhile p `eqP` (unpackS . S.unstream . S.dropWhile p)
548sf_dropWhile q p = (L.dropWhile p . L.filter q) `eqP`
554sf_dropWhile q p = (L.dropWhile p . L.filter q) `eqP`
@@ -1170,10 +1176,13 @@ tests =
1170 testProperty "s_takeWhile_s" s_takeWhile_s,
1176 testProperty "s_takeWhile_s" s_takeWhile_s,
1171 testProperty "sf_takeWhile" sf_takeWhile,
1177 testProperty "sf_takeWhile" sf_takeWhile,
1172 testProperty "t_takeWhile" t_takeWhile,
1178 testProperty "t_takeWhile" t_takeWhile,
1179+ testProperty "t_takeWhile_null" t_takeWhile_null,
1173 testProperty "tl_takeWhile" tl_takeWhile,
1180 testProperty "tl_takeWhile" tl_takeWhile,
1181+ testProperty "tl_takeWhile_null" tl_takeWhile_null,
1174 testProperty "t_takeWhileEnd" t_takeWhileEnd,
1182 testProperty "t_takeWhileEnd" t_takeWhileEnd,
1175 testProperty "t_takeWhileEnd_null" t_takeWhileEnd_null,
1183 testProperty "t_takeWhileEnd_null" t_takeWhileEnd_null,
1176 testProperty "tl_takeWhileEnd" tl_takeWhileEnd,
1184 testProperty "tl_takeWhileEnd" tl_takeWhileEnd,
1185+ testProperty "tl_takeWhileEnd_null" tl_takeWhileEnd_null,
1177 testProperty "sf_dropWhile" sf_dropWhile,
1186 testProperty "sf_dropWhile" sf_dropWhile,
1178 testProperty "s_dropWhile" s_dropWhile,
1187 testProperty "s_dropWhile" s_dropWhile,
1179 testProperty "s_dropWhile_s" s_dropWhile_s,
1188 testProperty "s_dropWhile_s" s_dropWhile_s,