Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Created September 9, 2021 04:32
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/30f077fc00dcecec6fdac19647f4e40f to your computer and use it in GitHub Desktop.
Save dustinlacewell/30f077fc00dcecec6fdac19647f4e40f to your computer and use it in GitHub Desktop.
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
@dustinlacewell
Copy link
Author

• 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment