[Haskell-cafe] IFF reader and writer

Sven Panne sven.panne at aedion.de
Fri Dec 1 12:54:21 EST 2006


Am Freitag, 1. Dezember 2006 16:30 schrieb Henning Thielemann:
> On AmigaOS there is a library called iffparse.library, which is used for
> processing the Interchange File Format, which is a binary container format
> developed by Electronic Arts for any kind of data.
>   http://en.wikipedia.org/wiki/Interchange_File_Format
>     The best known instances of this format are certainly the AIFF sampled
> sound format and WAV (which is RIFF, that is little endian IFF).
>  Short question: Is there some Haskell library for parsing and
> constructing files of this format?

I don't have any Haskell lib for (R)IFF, but as one of the freealut authors I 
have the "pleasure" to maintain a WAV reader, among other things. IMHO WAV is 
one of the most idiotic, redundant and underspecified format in the world, 
and most existing WAV files are broken in some respect. PNGs are a bit 
better, but all those chunked formats are a bit problematic in practice, 
because new chunk types are constantly being invented, contradict other 
chunks, etc. etc.

Quite a few concrete (R)IFF instances can contain (R)IFF within chunks 
themselves, furthermore you have always be prepared to handle an unknown 
chunk type. So a general (R)IFF type can't be much more than a tree with a 
tagged bunch of bytes at each node, which is not really of much help IMHO. 
Separate libraries for handling WAV, TIFF, PNG, AVI, etc. might make more 
sense, as they can reflect the underlying structure much better.

Cheers,
   S.


More information about the Haskell-Cafe mailing list