[Haskell-beginners] Typing/N00b question/My first haskell

Bryan Hunt sentimental.bryan at gmail.com
Mon Nov 21 13:04:04 CET 2011


Thank you for your helpful replies, program works correctly now:

module Main where

ageJudge age
   | age >= 40 = "You're too old!"
   | age <= 30 = "You're too young"
   | otherwise   = "Not in the programming age range.."

main = do
   putStrLn "What is your name?"
   name <- getLine
   putStrLn ("Nice to meet you, " ++ name ++ "!")
   putStrLn "What is your age?"
   age <- getLine
   let inpIntegral = (read age)::Int
   putStrLn ( "We decided:\n" ++ ageJudge inpIntegral )







More information about the Beginners mailing list