-
-
Save dustinlacewell/30f077fc00dcecec6fdac19647f4e40f to your computer and use it in GitHub Desktop.
This file contains 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
capper :: Bool -> Char -> (Bool, Char) | |
capper _ '.' = (True, '.') | |
capper b c | |
| isAlpha c = (False, toUpper c) | |
| otherwise = (b, c) | |
capParagraphs :: String -> (Bool, Char) | |
capParagraphs = mapAccumL capper True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
• Couldn't match type ‘[Char]’ with ‘Char’
Expected type: String -> (Bool, Char)
Actual type: [Char] -> (Bool, [Char])
• In the expression: mapAccumL capper True
In an equation for ‘capParagraphs’:
capParagraphs = mapAccumL capper True