I'm trying to get a random Int from a list and I'm having some issues because the only libraries that we're allowed to use are QuickCheck, GHC.IO and Data.List.
So far I managed to get a random IO Int by using:
ran :: Gen Int
ran = choose (0,3)
(The list has length=4)
But when I call
elem = list !! generate ran
I get: Couldn't match expected type ‘Int’ with actual type ‘IO Int’
And i'm pretty sure you can't "extract" only the Int from an IO Int so i'm kinda lost.
¿Any ideas?