Ad
Code
Diff
  • module ToUpperFirst where
    
    import Data.Char
    import Data.List
        
    mapcap :: String -> String
    mapcap = concat . intersperse " " . fmap (\(l:ls) -> (toUpper l):ls) . words
    
    • module ToUpperFirst where
    • import Data.Char
    • import Data.Char
    • import Data.List
    • toUpperFirst "" = ""
    • toUpperFirst (x : xs) = (toUpper x) : xs
    • mapcap :: String -> String
    • mapcap = concat . intersperse " " . fmap (\(l:ls) -> (toUpper l):ls) . words