[commit: packages/binary] ghc-head: README updated with markdown format. (c2ec8d6)
git at git.haskell.org
git at git.haskell.org
Fri Aug 30 15:20:33 CEST 2013
Repository : ssh://git@git.haskell.org/binary
On branch : ghc-head
Link : http://git.haskell.org/?p=packages/binary.git;a=commit;h=c2ec8d6bdf410fca52aeb82d3d428597c5a5895f
>---------------------------------------------------------------
commit c2ec8d6bdf410fca52aeb82d3d428597c5a5895f
Author: Daniel Díaz <dhelta.diaz at gmail.com>
Date: Tue Apr 16 21:24:03 2013 -0300
README updated with markdown format.
The README now follows the markdown format, suitable to display in the GitHub repository site. Also, the documentation in this file has been slightly extended.
>---------------------------------------------------------------
c2ec8d6bdf410fca52aeb82d3d428597c5a5895f
README.md | 67 ++++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 42 insertions(+), 25 deletions(-)
diff --git a/README.md b/README.md
index cd9c2e6..99b9425 100644
--- a/README.md
+++ b/README.md
@@ -1,28 +1,45 @@
+# binary package #
-binary: efficient, pure binary serialisation using lazy ByteStrings
--------------------------------------------------------------------
+*Efficient, pure binary serialisation using lazy ByteStrings.*
The ``binary`` package provides Data.Binary, containing the Binary class,
and associated methods, for serialising values to and from lazy
ByteStrings.
-A key feature of 'binary' is that the interface is both pure, and efficient.
+A key feature of ``binary`` is that the interface is both pure, and efficient.
The 'binary' package is portable to GHC and Hugs.
-Building:
+## Building binary ##
- runhaskell Setup.lhs configure
- runhaskell Setup.lhs build
- runhaskell Setup.lhs install
+To build binary you can run the following commands in the binary package folder.
+
+ $ runhaskell Setup.lhs configure
+ $ runhaskell Setup.lhs build
+ $ runhaskell Setup.lhs install
+
+If you have cabal installed you can also install the ``binary`` package using it.
+
+ $ cabal install binary
+
+If you have your cabal package database updated, it will download and install the last
+version of ``binary`` released on Hackage.
+
+## Using binary ##
First:
+
import Data.Binary
and then write an instance of Binary for the type you wish to serialise.
+You can also use the Data.Binary.Builder module to efficiently build
+lazy bytestrings using the ``Builder`` monoid. Or, alternatively, the
+Data.Binary.Get and Data.Binary.Put to serialize/deserialize using
+the ``Get`` and ``Put`` monads.
+
More information in the haddock documentation.
-Deriving:
+## Deriving binary instances ##
It is possible to mechanically derive new instances of Binary for your
types, if they support the Data and Typeable classes. A script is
@@ -59,20 +76,20 @@ provided in tools/derive. Here's an example of its use.
7 -> get >>= \a -> return (ExpInt a)
_ -> fail "no decoding"
-Contributors:
-
- Lennart Kolmodin
- Duncan Coutts
- Don Stewart
- Spencer Janssen
- David Himmelstrup
- Björn Bringert
- Ross Paterson
- Einar Karttunen
- John Meacham
- Ulf Norell
- Tomasz Zielonka
- Stefan Karrmann
- Bryan O'Sullivan
- Bas van Dijk
- Florian Weimer
+## Contributors ##
+
+* Lennart Kolmodin
+* Duncan Coutts
+* Don Stewart
+* Spencer Janssen
+* David Himmelstrup
+* Björn Bringert
+* Ross Paterson
+* Einar Karttunen
+* John Meacham
+* Ulf Norell
+* Tomasz Zielonka
+* Stefan Karrmann
+* Bryan O'Sullivan
+* Bas van Dijk
+* Florian Weimer
More information about the ghc-commits
mailing list