This is my attempt of re-implementing the standard words function:
isSpace' x = x == ' '
removeFirst [] = []
removeFirst (x:xs) = if isSpace' x then removeFirst xs else (x:xs)
break' p xs = break'' p xs []
where
break'' p (x:xs) ys = if (p x) then (ys, x:xs) else break'' p xs (ys ++ [x])
break'' _ [] ys = (ys, "")
words' x = words'' ("", x)
where
words'' (_, "") = []
words'' (a, b) = [q] ++ words'' (q, r)
where
q = fst (break' isSpace' b)
r = removeFirst (snd (break' isSpace' b))