@@ -138,12 +138,11 @@ prop_split_i c = id `eq` (T.intercalate (T.singleton c) . T.split c)
139prop_splitWith p = splitWith p `eqP` (map unpack . T.splitWith p)
139prop_splitWith p = splitWith p `eqP` (map unpack . T.splitWith p)
141−splitWith _ [] = [""]
141+splitWith _ "" = []
142−splitWith p xs = h : splitWith p (whale t)
142+splitWith p s = if null s'
144+ else l : splitWith p (tail s')
143− where (h,t) = break p xs
145+ where (l, s') = break p s
148prop_breakSubstring_isInfixOf s l
147prop_breakSubstring_isInfixOf s l
149 = T.isInfixOf s l ==
148 = T.isInfixOf s l ==
@@ -275,7 +274,7 @@ tests = [
275 ("prop_tails", mytest prop_tails),
274 ("prop_tails", mytest prop_tails),
277 ("prop_split_i", mytest prop_split_i),
276 ("prop_split_i", mytest prop_split_i),
278−--("prop_splitWith", mytest prop_splitWith),
277+ ("prop_splitWith", mytest prop_splitWith),
279 ("prop_breakSubstringC", mytest prop_breakSubstringC),
278 ("prop_breakSubstringC", mytest prop_breakSubstringC),
280 ("prop_breakSubstring_isInfixOf", mytest prop_breakSubstring_isInfixOf),
279 ("prop_breakSubstring_isInfixOf", mytest prop_breakSubstring_isInfixOf),