Implementing Haskell#words
words treats any whitespace as a separator, not just spaces. Use Data.Char.isSpace.

It's fine otherwise.

When reimplementing the standard library, you can exploit the standard version as a reference implementation to compare your version to:

map (\x -&gt; words x == words' x) ["", "  ", "a", "a ", " a", "a  b", "aa bb", "aa\nbb", "a b\nc\td"]