H98 Text IO

Chris Kuklewicz haskell at list.mightyreason.com
Wed Feb 27 03:54:17 EST 2008


Small correction:

I think "./prog in vs ./prog < in " and "utf8" should be "ok".

(and I thought this was switched to Glasgow-haskell-users at haskell.org)

David Leuschner wrote:
 >> Let me try and summarise:
 >
 > Thanks for the great summary! And thanks to Emacs' table mode here're the
 > results displayed as a table:
 >
 > +--------------------------------+-----+--------+------+-------+-------+
 > |                                | now | locale | utf8 | mix-A | mix-B |
 > +--------------------------------+-----+--------+------+-------+-------+
 > | putStrLn "..."                 |  -  |   ok   |  -   |  ok   |  ok   |
 > +--------------------------------+-----+--------+------+-------+-------+
 > | ./prog vs ./prog | cat         | ok  |   ok   |  ok  |  -    |  ok   |
 > +--------------------------------+-----+--------+------+-------+-------+
 > | ./prog in vs ./prog < in       |  -  |   ok   |  -   |  ok   |  -    |
 > +--------------------------------+-----+--------+------+-------+-------+
 > | ./prog vs ./prog | hexdump -C  | ok  |   ok   |  ok  |  -    |  ok   |
 > +--------------------------------+-----+--------+------+-------+-------+
 >
 >
 > The mixtures are good ideas but can give inconsistent and suriprising
 > results (especially when debugging encoding issues).  And if our CEO would
 > have known that ... putStrLn <his-name> ...  doesn't work he'd have
 > probably ruled out Haskell right from the start.  Even "utf8" gives
 > surprising results: I'd be very surprised if my Mac-written Haskell
 > program outputs junk on Windows or Linux even if the byte sequence is
 > exactly the same UTF-8 text.
 >
 > Personally I think consistency on a single platform is more important than
 > trying to achieve cross-platform consistency which involves a lot more
 > than just encoding.  If you've reached that point with your program you're
 > probably anyway using "advanced functions" to exactly specify what will be
 > output.  Following "the principle of least surprise" is also a good idea.
 >
 > Cheers,
 >
 >    David
 >
 >
 >
 >
 > ------------------------------------------------------------------------
 >
 > _______________________________________________
 > Libraries mailing list
 > Libraries at haskell.org
 > http://www.haskell.org/mailman/listinfo/libraries



More information about the Libraries mailing list