I know that there are other ways of doing it, I just want to understand
where lies the problem here.

I just read the realworldhaskell book by O'Reilly, in one section, Lazy I/O [0], it's explained
that there should be no problem writing big strings, without consuming the whole string
to files, however big they are.

I would appreciate it if someone could point out the problem there.

Thanks

[0]: http://book.realworldhaskell.org/read/io.html#io.lazy