Ivan Miljenovic gmail.com> writes:
>
> Since my answer before to your question obviously wasn't clear enough,
> let me highlight the lines of the error message that summarise what
> you have to do:
>
> On 22 March 2010 14:31, adamtheturtle hotmail.com>
wrote:
>
So I have the code
shuffle :: Int -> [a] -> [a]
shuffle i [] = []
shuffle i cards = (cards!!i) : shuffle (fst pair) (delete (cards!!i) cards)
where pair = randomR (0, 51) (mkStdGen 42)
and it doesn't work, am I missing something?
Cards.hs:39:51:
Could not deduce (Eq a) from the context
boblettoj msn.com> writes:
>
>
> Haha, much better now!
> Thanks for all your help, it's working great!
>
>
Just tried the code
shuffle :: Int -> [a] -> [a]
shuffle i [] = []
shuffle i cards = [(cards!!i) : shuffle (fst pair) (delete (cards!!i)
cards)]
where pair = randomR (0, 51)