@@ -138,12 +138,11 @@ prop_split_i c = id `eq` (T.intercalate (T.singleton c) . T.split c)
138138{-
139139prop_splitWith p = splitWith p `eqP` (map unpack . T.splitWith p)
140140
141−splitWith _ [] = [""]
142−splitWith p xs = h : splitWith p (whale t)
143− where (h,t) = break p xs
144− whale (_:xs) = xs
145− whale xs = xs
146−-}
141+splitWith _ "" = []
142+splitWith p s = if null s'
143+ then [s]
144+ else l : splitWith p (tail s')
145+ where (l, s') = break p s
147146
148147prop_breakSubstring_isInfixOf s l
149148 = T.isInfixOf s l ==
@@ -275,7 +274,7 @@ tests = [
275274 ("prop_tails", mytest prop_tails),
276275
277276 ("prop_split_i", mytest prop_split_i),
278−--("prop_splitWith", mytest prop_splitWith),
277+ ("prop_splitWith", mytest prop_splitWith),
279278 ("prop_breakSubstringC", mytest prop_breakSubstringC),
280279 ("prop_breakSubstring_isInfixOf", mytest prop_breakSubstring_isInfixOf),
281280