[Haskell-cafe] runInteractiveProcess and hGetLine on Windows

Andrew Coppin andrewcoppin at btinternet.com
Wed May 7 14:54:42 EDT 2008

David Roundy wrote:
> "\r\n" as newline should die a rapid death... windows is hard enough
> without maintaining this sort of stupidity.

Windows *does* do a number of very silly things. However, Windows isn't 
going away any time soon. And personally, I'd prefer it if we could make 
it easier to support it in Haskell.

I think a pure function that takes text formatted in any way and 
transforms it into some kind of "canonical" form would be a useful 
starting point. You'd probably want a platform-specific inverse function 
too. (I notice that FilePath manages to work differently on different 
platforms, so it's possible.) Currently the only way to do these 
transformations is to set the right channel mode at the instant you read 
the text. If we had a set of pure functions, you could transform the 
text after it's read - even if it's read in the wrong file mode, or you 
don't know whether it's text or binary until later.

More information about the Haskell-Cafe mailing list