
30 Apr
2009
30 Apr
'09
7:57 a.m.
import System.Random
rollDice :: IO Int rollDice = getStdRandom (randomR (1,6))
rollNDice :: Int -> [IO Int] rollNDice 0 = [] rollNDice n = rollDice : rollNDice (n-1)
replicateM n rollDice
Or, if you want the original idea: sequence (rollNDice 10) Check the type of sequence at Control.Monad. Maurício