[Haskell-cafe] HDF5 binding
wferi at niif.hu
Fri Mar 4 14:25:46 CET 2011
James Andrew Cook <mokus at deepbondi.net> writes:
> What an interesting coincidence, that makes at least three of
> us. Apparently it's an idea whose time has come.
> Mine is also an incomplete low-level binding but is currently under
> semi-active development and I aim to make it cover the entire hdf5.h
> If anyone is interested in it I've put it on github at:
This is fairly extensive indeed! I got nowhere near this, but also took
a somewhat different angle, especially by using StorableArrays for
passing arrays around (I used HDF5 in conjunction with LaPack). I also
experienced with going a little higher level here and there. Attributes
aren't implemented yet, because that would require making location ids a
type class. An unsolved problem is the safe representation of ranks: I
went for generality by using lists for indexing, but it would be nice to
express dimensionality constraints in the types (with sane syntax).
Maybe there's a handy technique for this, I didn't explore the field.
Talking about indexing, choosing Fortran convention seems to be a
mistake in retrospect, but that's no big deal.
I attach my code so you can get a better idea what I'm talking about,
maybe you can find some usable pieces. Separating the generic hid type
into specific newtypes worked out to some extent, but maybe isn't a good
idea at the lowest level (where the FFI makes it automatic). I'd need
broader experience with the HDF5 API to tell.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 14087 bytes
Desc: not available
More information about the Haskell-Cafe