Anonymous user
User Input: Difference between revisions
m
→{{header|Haskell}}
m (Moved to Text and Basic learning cats) |
|||
Line 165:
str <- getLine
putStr "Enter an integer: "
num <-
putStrLn $ str ++ (show num)
Note: <tt>:: IO Int</tt> is only there to disambiguate what type we wanted from <tt>read</tt>. If <tt>num</tt> were used in a numerical context, its type would have been inferred by the interpreter/compiler.
|