Skip to content

Instantly share code, notes, and snippets.

View tgdn's full-sized avatar

Thomas Gak-Deluen tgdn

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tgdn on github.
  • I am tgdn (https://keybase.io/tgdn) on keybase.
  • I have a public key ASB1wazD7RSV3a5N-VfIiY2f8pA0sv_lglJZhn8IeQSQCAo

To claim this, I am signing this object:

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)