ZVON > References > Haskell reference
| Indexes | Syntax | >> Prelude << | Ratio | Complex | Numeric | Ix | Array | List | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: Prelude
Function: readLn
Type: Read a => IO a
Description:
Related:

Example 1
Program source: 

main = do x <- getDouble
	  y <- getDouble
          print (x+y)

getDouble :: IO Double
getDouble = readLn

Input: 12

Input: 4.34

Output: 16.34

Example 2
Program source: 

main = do x <- getList
	  print (product x)

getList :: IO [Int]
getList = readLn

Input: [1,2,3,4]

Output: 24

Example 3
Program source: 

main = do x <- aaa
	  print x
	  
aaa :: IO (Int,Int,[Int])	  
aaa = do x <- readLn
	 return (sum x, product x, x)

Input: [1,3,5]

Output: (9,15,[1,3,5])




_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet




Related sites:
  • dotNet Slackers - Your latest resource for ASP.NET
  • Dotnet Spider - Outsourcing and Offshore software development in India
  • XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
  • Planet Source Code - The largest public source code database on the Internet
conference call service UNLIMITED Web Hosting by HostDepartment Alojamiento Web Domain Names answering service
MSN VoIP Internettelefonie Hosted Exchange, SDSL VoIP Internettelefonie AT VoIP Internettelefonie DE