
Brent Yorgey wrote:
On Thu, Jul 30, 2009 at 05:04:54PM -0700, Michael P Mossey wrote:
Where can I find MonadRandom or Control.Monad.Random to install? It doesn't seem to be a system library, I can't find it with cabal or Hoogle.
'cabal install MonadRandom' ought to work. Note that you may have to 'cabal update' first to make sure cabal has the most up-to-date package list. You can also always look at the complete list of packages on Hackage by going to hackage.haskell.org.
-Brent _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
That worked. I'm looking at this example from the docs. I understand most of this but I can't find a definition of getRandomR. See die has type (Rand g Int) I'm assuming getRandomR is a function that has that type, but I can't find its definition. import Control.Monad.Random die :: (RandomGen g) => Rand g Int die = getRandomR (1,6) dice :: (RandomGen g) => Int -> Rand g [Int] dice n = sequence (replicate n die) main = do values <- evalRandIO (dice 2) putStrLn (show values)