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

Module: Random
Function: next
Type: RandomGen a => a -> (Int,a)
Class: RandomGen
Description: The next operation allows one to extract at least 30 bits (one Int's worth) from the generator, returning a new generator as well. The integer returned may be positive or negative.
Related:

Example 1
Program source: 

import Random 

main = do x <- getStdGen
	  print (next x)
	  print (next x)
	  print (fst (next x))
	  setStdGen (snd (next x))
	  print (next x)
	  x <- getStdGen
	  print (next x)
	  newStdGen
	  print (next x)
	  x <- getStdGen
	  print (next x)

Output: (433334474,763021058 329686584)

Output: (433334474,763021058 329686584)

Output: 433334474

Output: (433334474,763021058 329686584)

Output: (473117066,750799641 277682575)

Output: (473117066,750799641 277682575)

Output: (1349143456,750839655 1549179761)




_____________________________________________
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
UNLIMITED Web Hosting by HostDepartment Alojamiento Web UK Domain Names glossary for conference call answering service
MSN VoIP Internettelefonie Hosted Exchange, SDSL VoIP Internettelefonie AT VoIP Internettelefonie DE