Re: Varia



About this list Date view Thread view Subject view Author view

Malcolm Wallace (malcolm-nhc@cs.york.ac.uk)
Mon, 8 Jan 2001 16:01:48 +0000


> Array.// takes time size_of_array * number_of_changed_elements. Actually, I think: size_of_array + number_of_changed_elements, which is considerably better than quadratic, but still probably too slow. We should be able to reduce the constant factor when rebuilding the whole size_of_array (by direct mem->mem copy instead), such that number_of_changed_elements becomes the dominant factor. > Array.accum has quadratic time too. It rebuilds the array completely for each new element, which is very inefficient, yes. We can make this a lot faster too I reckon, with the same direct mem->mem copy trick. > character literals are indeed wide; characters in string literals > are always truncated to 8bit. Could they be made truly wide? String literals are currently truncated when the compiler generates a byte-oriented representation in the object code. I imagine we could go to a 16- or 32-bit representation in object code without too much difficulty. I wouldn't be keen on adopting a variable-width coding like UTF-8, unless you can point me in the direction of a C-library which could do most of the work for me...? > I would like to access the representation of IOError and throw > IOErrorC. I can steal DIOError.hi and DErrNo.hi, but could it be > done in a more official way? Most of the explicit constructors in the IOError datatype are going to vanish soon anyway, leaving just IOErrorC, IOErrorEOF, and IOErrorUser. There is no currently-exported interface function that allows you to throw an IOErrorC with a specific ErrNo (or Int), but I can offer you the opportunity to specify one if you like. :-) What signature do you prefer? Where would you like it to be exported from? > Using the value maxBound::Word32 or a large Word32 literal outputs > "Warning: fromInteger truncates to fit Word32 value". Yes, I still haven't quite got the Integer -> sized type conversions implemented. These warnings are stubs to remind me to finish it off. > Bug in namespace handling > > module Test (stdout) where > import qualified IO > import IO (hClose) > test = stdout > > stdout should not be visible, but this module compiles without errors Yes, this appears to be a bug. I'll try to find time to look into it. > main = let s@_ = "Bug" in print s > > This program prints "". Another bug. Again, I'll look at it. Thanks for the reports! Regards, Malcolm


About this list Date view Thread view Subject view Author view