Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- from http://stackoverflow.com/questions/10080273/how-to-get-good-performance-when-writing-a-list-of-integers-from-1-to-10-million
- import Data.Monoid
- import Data.Text.Lazy.IO as Text
- import Data.Text.Lazy.Builder as Text
- import Data.Text.Lazy.Builder.Int as Text
- import Data.Vector as V
- decimals = V.generate 10000000 (\i -> Text.decimal $ i + 1)
- with_newlines = V.map (`mappend` Text.singleton '\n') decimals
- concatd = V.foldr1 mappend with_newlines
- main = Text.putStrLn . Text.toLazyText $ concatd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement