>>> wordsBy (`elem` ",;.?! ") "Hello there, world! How?" ["Hello","there","world","How"]
>>> wordsBy (=='x') "dogxxxcatxbirdxx" ["dog","cat","bird"]
wordsBy (== ':') "::xyz:abc::123::" == ["xyz","abc","123"] \s -> wordsBy isSpace s == words s
>>> wordsBy' p xs = Stream.toList $ Stream.wordsBy p Fold.toList (Stream.fromList xs)
>>> wordsBy' (== ',') "" []
>>> wordsBy' (== ',') "," []
>>> wordsBy' (== ',') ",a,,b," ["a","b"]
words = wordsBy isSpace
>>> wordsBy (== ':') "bd:3" ["bd", "3"]
>>> wordsBy (=='x') (BV.fromList "dogxxxcatxbirdxx") ["dog","cat","bird"]