Last active
April 19, 2017 21:25
-
-
Save hergaiety/3030c129b3ce3ce5e889601fc3009491 to your computer and use it in GitHub Desktop.
String To List Of Words
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toWords :: String -> [String] | |
toWords x | |
| length x == 0 = [] | |
| otherwise = takeWhile (/= ' ') x : toWords (drop 1 (dropWhile (/= ' ') x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment