2024-05-26 00:36:26 -05:00
|
|
|
import Data.List (nub)
|
|
|
|
import System.Random (getStdGen, randomRs)
|
2024-05-25 19:28:16 -05:00
|
|
|
|
|
|
|
rndSelect :: [a] -> Int -> IO [a]
|
|
|
|
rndSelect ls n = do
|
|
|
|
gen <- getStdGen
|
|
|
|
return $ take n [ls !! m | m <- nub $ randomRs (0, length ls - 1) gen]
|