on master help sign in
Data.Text.Lazy.splitWith: Make the matching exhaustive.

--HG-- extra : convert_revision : b6e33b6601d8e43c864c5ceff0eb37232f305954

commitd7fa7d150eb8c1155c21ea09d7276441e4731c9d authorNicolas Pouillard <nicolas.pouillard@gmail.com> dateFri 6 Mar 2009, 09:31 (18 years ago) parent5b717cd
1 file changed+4
Data/Text/Lazy.hs+4
Data/Text/Lazy.hs+4
@@ -715,6 +715,7 @@ splitWith p (Chunk t0 ts0) = comb [] (T.splitWith p t0) ts0
715715 where comb acc (s:[]) Empty = revChunks (s:acc) : []
716716 comb acc (s:[]) (Chunk t ts) = comb (s:acc) (T.splitWith p t) ts
717717 comb acc (s:ss) ts = revChunks (s:acc) : comb [] ss ts
718+ comb _ [] _ = impossibleError "splitWith"
718719{-# INLINE splitWith #-}
719720
720721-- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at
@@ -736,3 +737,6 @@ revChunks = L.foldl' (flip chunk) Empty
736737
737738emptyError :: String -> a
738739emptyError 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")