Skip to content

Instantly share code, notes, and snippets.

@darthdeus
Created February 2, 2014 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darthdeus/8774659 to your computer and use it in GitHub Desktop.
Save darthdeus/8774659 to your computer and use it in GitHub Desktop.
takeN :: Int -> [a] -> IO [a]
takeN n xs = sequence $ map (\_ -> sample xs) (replicate n 1)
takeN n xs = replicateM n (sample xs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment