Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Created September 9, 2021 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell/d7d0b76645b8720289024dc711027474 to your computer and use it in GitHub Desktop.
Save dustinlacewell/d7d0b76645b8720289024dc711027474 to your computer and use it in GitHub Desktop.
capper :: Bool -> Char -> (Bool, Char)
capper _ '.' = (True, '.')
capper b c
| isAlpha c && b = (False, toUpper c)
| otherwise = (b, c)
capParagraphs :: String -> (Bool, String)
capParagraphs = mapAccumL capper True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment