on master help sign in
Data.Text.Lazy.splitWith: Make the matching exhaustive.
d7fa7d1Nicolas Pouillard
Data/Text/Lazy.hs+4
@@ -715,6 +715,7 @@ splitWith p (Chunk t0 ts0) = comb [] (T.splitWith p t0) ts0
715 where comb acc (s:[]) Empty = revChunks (s:acc) : []
715 where comb acc (s:[]) Empty = revChunks (s:acc) : []
716 comb acc (s:[]) (Chunk t ts) = comb (s:acc) (T.splitWith p t) ts
716 comb acc (s:[]) (Chunk t ts) = comb (s:acc) (T.splitWith p t) ts
717 comb acc (s:ss) ts = revChunks (s:acc) : comb [] ss ts
717 comb acc (s:ss) ts = revChunks (s:acc) : comb [] ss ts
718+ comb _ [] _ = impossibleError "splitWith"
718{-# INLINE splitWith #-}
719{-# INLINE splitWith #-}
719
720
720-- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at
721-- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at
@@ -736,3 +737,6 @@ revChunks = L.foldl' (flip chunk) Empty
736
737
737emptyError :: String -> a
738emptyError :: String -> a
738emptyError fun = P.error ("Data.Text.Lazy." ++ fun ++ ": empty input")
739emptyError fun = P.error ("Data.Text.Lazy." ++ fun ++ ": empty input")
740+
741+impossibleError :: String -> a
742+impossibleError fun = P.error ("Data.Text.Lazy." ++ fun ++ ": impossible case")