Created
June 9, 2017 23:20
-
-
Save NotTheEconomist/5749eef9524bdb3f84c7916c3cc2e698 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
import Data.Char(toUpper, toLower) | |
alternateCase :: String -> String | |
alternateCase [] = [] | |
alternateCase (x:[]) = [toUpper x] | |
alternateCase (x:y:xs) = (toUpper x):(toLower y):(alternate xs) | |
alternateCase "abcdefg" | |
-- "AbCdEfG" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment