Personal tools

Binary IO

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(link fix)
(fixed dead links)
(4 intermediate revisions by 3 users not shown)

Revision as of 21:33, 29 October 2011

1 Data.Binary

There are a number of binary I/O libraries available for Haskell. The best to use is the new, semi-standard Data.Binary library:

   * Data.Binary

It's very simple to use, and provides a highly efficient, pure interface to binary serialisation.

A tutorial:

   * Serialisation_and_compression_with_Data_Binary

See also DealingWithBinaryData

2 Other libraries

For very simple serialisation, use

If you have simple binary IO requirements, then Data.ByteString might be easiest -- you get a List-like interface to packed byte arrays (interface documented here). For more complex serialisation, Data.Binary would be preferred.