binary-serialise-cbor (empty) → 0.1.1.0
raw patch · 4 files changed
+111/−0 lines, 4 filesdep +basedep +bytestringdep +cborgsetup-changed
Dependencies added: base, bytestring, cborg, serialise
Files
- LICENSE.txt +33/−0
- Setup.hs +2/−0
- binary-serialise-cbor.cabal +48/−0
- src/Data/Binary/Serialise/CBOR/Read.hs +28/−0
+ LICENSE.txt view
@@ -0,0 +1,33 @@+Copyright (c) 2015-2017 Duncan Coutts,+ 2015-2017 Well-Typed LLP,+ 2015 IRIS Connect Ltd.++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are+met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Duncan Coutts nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ binary-serialise-cbor.cabal view
@@ -0,0 +1,48 @@+name: binary-serialise-cbor+version: 0.1.1.0+synopsis: Yet Another Binary Serialisation Library (compatibility shim)+license: BSD3+license-file: LICENSE.txt+author: Duncan Coutts+maintainer: duncan@community.haskell.org, ben@smart-cactus.org+bug-reports: https://github.com/well-typed/cborg/issues+copyright: 2015-2017 Duncan Coutts,+ 2015-2017 Well-Typed LLP,+ 2015 IRIS Connect Ltd+category: Codec+build-type: Simple+cabal-version: >= 1.21+tested-with: GHC == 7.10.3, GHC == 8.0.1++description:+ This package is a shim around @cborg@, exposing an interface compatible with+ the previous @binary-serialise-cbor@.++source-repository head+ type: git+ location: https://github.com/well-typed/cborg.git++library+ default-language: Haskell2010+ hs-source-dirs: src+ reexported-modules:+ Codec.Serialise as Data.Binary.Serialise.CBOR,+ Codec.Serialise.Class as Data.Binary.Serialise.CBOR.Class,+ Codec.Serialise.Decoding as Data.Binary.Serialise.CBOR.Decoding,+ Codec.Serialise.Encoding as Data.Binary.Serialise.CBOR.Encoding,+ Codec.CBOR.FlatTerm as Data.Binary.Serialise.CBOR.FlatTerm,+ Codec.Serialise.IO as Data.Binary.Serialise.CBOR.IO,+ Codec.CBOR.Magic as Data.Binary.Serialise.CBOR.Magic,+ Codec.CBOR.Pretty as Data.Binary.Serialise.CBOR.Pretty,+ Codec.Serialise.Properties as Data.Binary.Serialise.CBOR.Properties,+ Codec.CBOR.Write as Data.Binary.Serialise.CBOR.Write,+ Codec.CBOR.Term as Data.Binary.Serialise.CBOR.Term,+ Codec.Serialise.Tutorial as Data.Binary.Serialise.CBOR.Tutorial+ exposed-modules: Data.Binary.Serialise.CBOR.Read++ build-depends:+ base < 5,+ bytestring < 1.0,+ cborg == 0.1.*,+ serialise == 0.1.*+
+ src/Data/Binary/Serialise/CBOR/Read.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE RankNTypes #-}++-- |+-- Module : Data.Binary.Serialise.CBOR.Read+-- Copyright : (c) Duncan Coutts 2015-2017+-- License : BSD3-style (see LICENSE.txt)+--+-- Maintainer : duncan@community.haskell.org+-- Stability : experimental+-- Portability : non-portable (GHC extensions)+--+-- Tools for reading values in a CBOR-encoded format+-- back into ordinary values.+--+module Data.Binary.Serialise.CBOR.Read+ ( module X+ , deserialiseFromBytes+ ) where++import Codec.CBOR.Read as X hiding (deserialiseFromBytes)+import qualified Codec.CBOR.Read as Read+import Codec.CBOR.Decoding (Decoder)+import qualified Data.ByteString.Lazy as LBS++deserialiseFromBytes :: (forall s. Decoder s a)+ -> LBS.ByteString+ -> Either Read.DeserialiseFailure a+deserialiseFromBytes f = fmap snd . Read.deserialiseFromBytes f