On 9 November 2010 19:01, Mark Spezzano <[email protected]> wrote:
> Hi Ivan,
>
> Yes, I want it printed in a terminal window.
>
> I want to be able to run it from the command line in a terminal window, and 
> have the text come up in colours (but very fast). My current version is 
> already very fast, but I've heard everyone raving about how slow Strings were 
> to use for I/O, so I wanted to _experiment_ with ByteStrings to see the 
> performance difference.

I _think_ Bytestrings are more efficient when dealing with files,
networks, etc.; I don't think there would be any noticeable
improvement in efficiencies for terminal I/O (probably less, since I
think - but am quite possibly wrong - that printing to stdout and
reading from stdin still goes via String).

> I'm experimenting with writing a Zork-like text adventure game and I just 
> wanted to do some space/time profiling on different pieces of code and 
> observe the results. I thought that ByteStrings might be the way to go, but 
> can they be combined with the Doc type from the ansi-wl-pprint library?

Have you actually profiled your code to see if the I/O is indeed a bottleneck?

And no, unless you fork and convert it, ansi-wl-pprint can't use Bytestrings.

-- 
Ivan Lazar Miljenovic
[email protected]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to