Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- import System.Environment
- import Data.Char
- -- Exercise 6.1
- -- | Capitalize the first letter of a string
- capitalize :: String -> String
- capitalize [] = []
- capitalize (a:as) = toUpper a : unchange as
- where
- unchange [] = []
- unchange (a:as) = (a:as)
- main :: IO ()
- main = do
- putStrLn "Hello. I am a HAL 9000 series computer."
- name <- getEnv "USER"
- putStrLn $ "Good morning, " ++ capitalize name ++ "."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement