Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (17 sloc) 0.488 kb
module Common where
import Control.Monad.Random
import System.Random
import Data.Text (pack, Text)
import Data.Int
import Control.Monad.Identity
data Thing = Thing Int32 Int32 Text
randomThing :: (RandomGen g, Monad m) => RandT g m Thing
randomThing = do
a <- getRandom
b <- getRandom
c <- getRandomRs ('a', 'z')
return $ Thing a b $ pack $ take 10 c
genThings :: IO [Thing]
genThings = do
g <- newStdGen
return $ runIdentity $ evalRandT (sequence $ repeat randomThing) g
Jump to Line
Something went wrong with that request. Please try again.