Created
March 1, 2012 06:38
-
-
Save bradclawsie/1947841 to your computer and use it in GitHub Desktop.
random string of uppercase chars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Control.Monad.Random | |
import Data.Char | |
rnd :: (RandomGen g) => Rand g Int | |
rnd = getRandomR (65,90) | |
main = do | |
values <- evalRandIO (sequence (replicate 10 rnd)) | |
putStrLn $ map chr values | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment