This got a bit mangled, here's the fixed version: > > wordsBy :: (a -> Bool) -> [a] -> [[a]] > > wordsBy p s = case dropWhile p s of > > [] -> [] > > s':rest -> (s':w) : wordsBy p s'' > > where (w, s'') = break p rest