Last active
December 8, 2016 00:46
-
-
Save tgdn/44a56edafa1a3e2e0f780b12a9e7a3fe to your computer and use it in GitHub Desktop.
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
breakLines :: String -> [String] | |
breakLines s = br (s, "", []) | |
where | |
br :: (String, String, [String]) -> [String] | |
br ("", ss, ll) = ll ++ [ss] | |
br (x:xs, ss, ll) | |
| x == '\n' = br (xs, "", ll ++ [ss]) | |
| otherwise = br (xs, ss ++ [x], ll) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment