[Haskell-cafe] Outstanding context : (Num b, Random b)

"horsh" horsh at mail.ru
Thu Feb 26 23:07:42 EST 2004



Hi,

I am very new to haskell.

Could anyone please explain why these two things are not equivalent:

m2 = do  a <- (drawInt 1 10)
	 print a
drawInt :: Int -> Int -> IO Int
drawInt x y = getStdRandom (randomR (x,y))
	
m1 = do b <- getStdRandom (randomR (1,10))
	print b

the second one produces
*** Binding             : m1
*** Outstanding context : (Num b, Random b)

in Hugs.

thanks
horsh



More information about the Haskell-Cafe mailing list