gaiety revised this gist 3 months ago. Go to revision
1 file changed, 4 insertions
toWords.hs(file created)
| @@ -0,0 +1,4 @@ | |||
| 1 | + | toWords :: String -> [String] | |
| 2 | + | toWords x | |
| 3 | + | | length x == 0 = [] | |
| 4 | + | | otherwise = takeWhile (/= ' ') x : toWords (drop 1 (dropWhile (/= ' ') x)) | |
Newer
Older