[Haskell-cafe] Conflict with Network.CGI and System.Random

william murphy will.t.murphy at gmail.com
Wed Aug 24 01:50:05 CEST 2011

Hello all,

I'm trying to write a program to be converted into a cgi file using
Network.CGI and Text.Xhtml, and I want to have random numbers in it. Sounds
simple, but I need to call the global random generator (I think) and I can't
do that in the CGI block, i.e.

cgiTMain = do
            gen <- getStdGen

simply doesn't work, nor an variation of calling a function in the
cgiTMainblock with a type of IO(), which is what I need to get the
generator. Is it
impossible both to write a program using Network.CGI and have random values?
That seems very limiting, the people that wrote Haskell were smarter than


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110823/e0210c2c/attachment.htm>

More information about the Haskell-Cafe mailing list