Advertisement
Guest User

Untitled

a guest
Jan 5th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import qualified Data.ByteString.Lazy as L
  2. import qualified Data.ByteString.Char8 as C
  3.  
  4. chars =  ['A'..'Z'] ++ ['0'..'9']
  5.  
  6. colSizes :: [Int]
  7. colSizes = [4, 4, 4, 3, 5, 1, 1, 3, 3, 3, 3, 3, 3, 10, 3, 1, 1, 1, 2, 3, 10]
  8.  
  9. buildRow = [replicate (colSizes !! x) (chars !! x) | x <- [0.. length colSizes - 1]]
  10.  
  11. chunkSize :: Int
  12. chunkSize = 10000 -- lines
  13.  
  14. nl = C.singleton '\n'
  15.  
  16. rawBytes = C.intercalate nl . replicate chunkSize . C.pack . concat $ buildRow
  17.  
  18. lazyGenerator = L.cycle (L.fromStrict rawBytes)
  19.  
  20. main = L.putStr lazyGenerator
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement