22 Mar
2010
22 Mar
'10
3:44 a.m.
On Sun, Mar 21, 2010 at 11:31 PM, adamtheturtle <kill2thrill@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?
Are you familiar with class constraints? Try looking at the type of delete. (Use ":type" at the ghci prompt.) -- Dave Menendez <dave@zednenem.com> <http://www.eyrie.org/~zednenem/>