Martin Stein <[EMAIL PROTECTED]> writes:
>
> Hi,
>
> Are there functions to store/load lists and (mutable) arrays
> to/from files in
> ghc?
> I've only found functions providing the type Char.
> Is there any support for Int, Double...?
>
i.e., you want to splat them directly, and not go via Show&Read..?
No, there's no comprehensive support for that sort of thing - however
the following two ops might be of some use:
PrelHandle.hFillBufBA :: Handle
-> ByteArray Int -- input buffer
-> Int -- no. of bytes to read
-> IO Int -- no. of bytes read
PrelHandle.hPutBufBA :: Handle
-> ByteArray Int
-> Int -- no of bytes to blast out
-> IO ()
A more comprehensive soln is to use Sven Panne's ghc port of the
Binary library, which is available via the Green Card home page
http://www.dcs.gla.ac.uk/fp/software/green-card/
hth,
--Sigbjorn