Commits

Nicolas Pouillard committed 4da3c68

Data.Text.Lazy.splitWith: Make the matching exhaustive.

  • Participants
  • Parent commits 7938a65

Comments (0)

Files changed (1)

Data/Text/Lazy.hs

   where comb acc (s:[]) Empty        = revChunks (s:acc) : []
         comb acc (s:[]) (Chunk t ts) = comb (s:acc) (T.splitWith p t) ts
         comb acc (s:ss) ts           = revChunks (s:acc) : comb [] ss ts
+        comb _   []     _            = impossibleError "splitWith"
 {-# INLINE splitWith #-}
 
 -- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at
 
 emptyError :: String -> a
 emptyError fun = P.error ("Data.Text.Lazy." ++ fun ++ ": empty input")
+
+impossibleError :: String -> a
+impossibleError fun = P.error ("Data.Text.Lazy." ++ fun ++ ": impossible case")