-- Comp1100 Introduction to Programming and Algorithms
-- Sem 1, 2006
-- Clem Baker-Finch March 2006

-- Convert input lines to upper case

module Main where

import Data.Char

-- The computational part
allUpper :: String -> String
allUpper chs = map toUpper chs

-- Repeatedly get lines from input and apply allUpper to each
-- terminate on empty line
upperLine :: IO ()
upperLine 
 = do	line <- getLine
	if line == ""
	 then return ()                     -- base case
	 else do                            -- step case
		putStrLn (allUpper line)
		upperLine                   -- recursive call

main :: IO ()
main = do
       putStrLn "Start typing.  Terminate with an empty line."
       upperLine
	       

