Bryan O'Sullivan wrote:
(All of the above speaks of the 'high-level' Data.Binary not the 'low-level'.)

Data.Binary *is* the low-level Data.Binary :-)

I was distinguishing between these two levels:

(1) High-level = Binary typeclass. Contains instances for many, many useful common types, the internals of which you don't need to understand to use them. But then you wont' understand the format used. Which doesn't matter if all you want to do is pipe stuff around.

(2) Low-level = Get and Put typeclasses. Allow you to shovel bytes as you wish, including bundling them up into words of various sizes with explicit endian-ness control. You can sensibly use this to define file formats precisely with some reasonable expectation of speed. You could for example write a TIFF reader (and writer [*]) using these primitives.

Jules

[*] - exercise for the reader: Can you write a TIFF reader and writer simultaneously, in the sense that you define the file format once and get Get and Put instances for free?
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to