on master help sign in
Rewrite a few properties for clarity.
64b354aBryan O'Sullivan
tests/Properties.hs+3−5
@@ -323,14 +323,12 @@ splitWith p xs = loop xs
323 | otherwise = l : loop (tail s')
323 | otherwise = l : loop (tail s')
324 where (l, s') = break p s
324 where (l, s') = break p s
325
325
326−prop_T_chunksOf_same_lengths k t
326+prop_T_chunksOf_same_lengths k = all ((==k) . T.length) . ini . T.chunksOf k
327− = all ((==k) . T.length) . ini . T.chunksOf k $ t
328 where ini [] = []
327 where ini [] = []
329 ini xs = init xs
328 ini xs = init xs
330
329
331−prop_T_chunksOf_length k t = let len = L.foldl' f 0 (T.chunksOf k t)
332− in len == T.length t || (k <= 0 && len == 0)
330+prop_T_chunksOf_length k t = len == T.length t || (k <= 0 && len == 0)
333− where f s t = T.length t + s
331+ where len = L.sum . L.map T.length $ T.chunksOf k t
334
332
335prop_T_breakSubstring_isInfixOf s l
333prop_T_breakSubstring_isInfixOf s l
336 = T.isInfixOf s l ==
334 = T.isInfixOf s l ==