Haskell Input Return Tuple

Posted by peterwkc on Stack Overflow See other posts from Stack Overflow or by peterwkc
Published on 2010-06-18T02:57:58Z Indexed on 2010/06/18 3:03 UTC
Read the original article Hit count: 359

Filed under:
|

Hello to all, i wonder can a IO() function return tuple because i would like to get these out of this function as input for another function.

investinput :: IO()->([Char], Int)
investinput = do
 putStrLn "Enter Username : "
 username <- getLine

 putStrLn "Enter Invest Amount : "
 tempamount <- getLIne
 let amount = show  tempamount
 return (username, amount)

Please help.

Thanks.

© Stack Overflow or respective owner

Related posts about haskell

Related posts about input