How can I generate a random number in Haskell from a range (a, b) without using any seed?
The function should return an Int and not an IO Int. I have a function X t
fmap yourFunctionX $ randomRIO (a, b)
or
fmap (\x -> yourFunctionX aParam x anotherParam) $ randomRIO (a, b)
The result will then be of type IO whateverYourFunctionXReturns.
If you import Control.Applicative, you can say
yourFunctionX <$> randomRIO (a, b)
or
(\x -> yourFunctionX aParam x anotherParam) <$> randomRIO (a, b)
which you may find clearer