Hi Max, Wow!
I tried both *sequence* and *replicate* but guess I didn't put them together properly. I didn't even know there was a *replicateM*. Much cleaner. Thanks Michael --- On Sun, 7/25/10, Max Rabkin <[email protected]> wrote: From: Max Rabkin <[email protected]> Subject: Re: [Haskell-cafe] Random this! ;-) To: "michael rice" <[email protected]> Cc: [email protected] Date: Sunday, July 25, 2010, 11:44 AM On Sun, Jul 25, 2010 at 5:39 PM, michael rice <[email protected]> wrote: > > I know, ugly, but at least I got it to work. What's a better way to generate > this list? rollNDiceIO n = sequence . replicate n $ randomRIO (1,6) {{ sequence . replicate n = replicateM n }} = replicateM n $ randomRIO (1, 6) --Max
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
