module Shuffle (shuffle) where

import System.Random

shuffle [] = return []
shuffle xs = do
    i <- getStdRandom(randomR (0,(length xs)-1))::IO(Int)
    let (h:rst) = drop i xs
    oth <- shuffle $ (take i xs) ++ rst
    return (h:oth)