[Haskell-cafe] broken IO support in uvector package, when using
non primitive types
Manlio Perillo
manlio_perillo at libero.it
Fri Mar 13 18:50:54 EDT 2009
Daniel Fischer ha scritto:
> [...]
> Worked with uvector-0.1.0.1:
>
> [...]
> But not with uvector-0.2
> [...]
The main difference is that in uvector 0.2, hPutBU does not write in the
file the length of the array; hGetBU simply use the file size.
let elemSize = sizeBU 1 (undefined :: e)
n <- fmap ((`div`elemSize) . fromInteger) $ hFileSize h
So, the problem seems to be here.
This simply don't support having two arrays written in the same file,
and sizeBU belongs to the UAE class, whose instances are only declared
for builtin types.
So, the patch is: "just revert this change".
Regards Manlio
More information about the Haskell-Cafe
mailing list