> import qualified Char > words' :: String -> [String] > words' [] = [] > words' (x:xs) > | Char.isSpace x = words1 xs > | otherwise = case words' xs of > [] -> [[x]] > (ys:yss) -> (x:ys):yss > where > words1 [] = [] > words1 xs@(y:ys) > | Char.isSpace y = words1 ys > | otherwise = [] : case words' ys of > [] -> [[y]] > (zs:zss) -> (y:zs):zss > main = interact (unwords . words')