
Marcin 'Qrczak' Kowalczyk
Dnia pon 11. sierpnia 2003 00:49, Wolfgang Jeltsch napisał:
The main problem is that you need binary I/O. Haskell 98 only provides text I/O.
You don't need binary I/O for UTF-8 now; because implementations use ISO-8859-1, UTF-8 octets can be faked as characters by (chr . fromIntegral).
I wonder, Would it cause a lot of compatibility trouble to wrap IO functions in a class class IOData a where readFile :: FilePath -> a : and do instance IOData Char where ... instance IOData Word8 where ... (Defaulting to Char the same way as Integer) Would this let us start writing byte-based IO without sacrificing compatibility or designing specific interfaces for it? Perhaps one could even do record-based IO by declaring instantiation IOData for custom data structures? -kzm -- If I haven't seen further, it is by standing in the footprints of giants