[Haskell-cafe] IFF reader and writer

Henning Thielemann lemming at henning-thielemann.de
Fri Dec 1 13:02:37 EST 2006

On Fri, 1 Dec 2006, Sven Panne wrote:

> 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.

The idea is that unknown chunks can be ignored in most cases. Of course,
this is not always possible, but there are several examples where it

> 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. 

That's exactly what I ask for. Some of the features of the IFF like CAT
and PROP chunks are rarely used, maybe because there were no libraries
which support them.

> Separate libraries for handling WAV, TIFF, PNG, AVI, etc. might make more 
> sense, as they can reflect the underlying structure much better.

But they could all use a general IFF library. This way you can bundle
different kinds of data in one file, say sounds and pictures for an

More information about the Haskell-Cafe mailing list