H98 Text IO

John Meacham john at repetae.net
Tue Feb 26 10:28:07 EST 2008

On Tue, Feb 26, 2008 at 01:34:54PM +0000, Duncan Coutts wrote:
> Personally I'm not really fussed about which compromise we pick. I think
> the more important point is that all the Haskell implementations pick
> the same compromise so that we can effectively standardise the
> behaviour.

Wait, are you talking about changing what ghc does or trying to change
the haskell standard? I always thought ghc should do something more sane
with character IO, non unicode aware programs are a blight.

I don't think choosing something arbitrary to standardize on is a good
idea. It is not always clear what the best choice is. like, for instance
until recently, jhc used locale encoding on linux, due to glibc's strong
charset support and guarenteed use of unicode wchar_t's, but utf8 always
on bsd-varients, where the wchar_t situation was less clear cut. On
embedded systems, only supporting ASCII IO is certainly a valid choice.
For a .NET backend, we will want to use .NET's native character IO

The important thing is standardizing how _binary_ handles work across
compilers. As long as everyone has a compatible openBinaryHandle then we
can layer whatever we want on it with compatible libraries.

I think the current behavior of GHC is poor and should be fixed, I
believe the intent of the haskell 98 standard is that character IO be
performed in a suitable system specific way, which always truncating to
8bits does not meet IMHO. But no need to prescribe something arbitrary
language-wide for a particular issue with ghc.


John Meacham - ⑆repetae.net⑆john⑈

More information about the Glasgow-haskell-users mailing list