packages feed

packstream 0.1.0.0 → 0.1.0.1

raw patch · 9 files changed

+34/−22 lines, 9 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.PackStream.Structure: Date :: Int -> Date
- Data.PackStream.Structure: [days] :: Date -> Int
- Data.PackStream.Structure: data DateTime
- Data.PackStream.Structure: data DateTimeZoneId
- Data.PackStream.Structure: data Duration
- Data.PackStream.Structure: data LocalDateTime
- Data.PackStream.Structure: data LocalTime
- Data.PackStream.Structure: data Point2D
- Data.PackStream.Structure: data Point3D
- Data.PackStream.Structure: data Time
- Data.PackStream.Structure: newtype Date

Files

README.md view
@@ -1,7 +1,10 @@ # packstream -[![Travis](https://img.shields.io/travis/zmactep/packstream.svg)](https://travis-ci.org/zmactep/packstream)-[![GitHub Build](https://github.com/zmactep/packstream/workflows/build/badge.svg)](https://github.com/zmactep/packstream/actions?query=workflow%3A%22build%22)+[![Travis](https://img.shields.io/travis/com/zmactep/packstream)](https://travis-ci.com/zmactep/packstream)+[![GitHub Build](https://github.com/zmactep/packstream/workflows/8.10.1/badge.svg)](https://github.com/zmactep/packstream/actions?query=workflow%3A%228.10.1%22)+[![GitHub Build](https://github.com/zmactep/packstream/workflows/8.8.3/badge.svg)](https://github.com/zmactep/packstream/actions?query=workflow%3A%228.8.3%22)+[![GitHub Build](https://github.com/zmactep/packstream/workflows/8.6.5/badge.svg)](https://github.com/zmactep/packstream/actions?query=workflow%3A%228.6.5%22)+[![GitHub Build](https://github.com/zmactep/packstream/workflows/8.0.2/badge.svg)](https://github.com/zmactep/packstream/actions?query=workflow%3A%228.0.2%22) [![hackage](https://img.shields.io/hackage/v/packstream.svg)](https://hackage.haskell.org/package/packstream) [![hackage-deps](https://img.shields.io/hackage-deps/v/packstream.svg)](https://hackage.haskell.org/package/packstream) 
packstream.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: b8814ee71f844d4802d1ee000fc17039604d267030cc1a1fccb2b68c64a93bba+-- hash: d55d5d199583510c5e154e94d070d24639588316cf5fa50e70104fa10f4bf14c  name:           packstream-version:        0.1.0.0+version:        0.1.0.1 synopsis:       PackStream converter for Neo4j BOLT protocol description:    Please see the README on GitHub at <https://github.com/zmactep/packstream#readme> category:       Data
src/Data/PackStream.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP #-} module Data.PackStream (   PackStreamError (..), PackStream (..), PackStreamValue (..)@@ -17,6 +18,9 @@ import Data.Map.Strict (Map) import Control.Monad.Except (MonadError(..), liftEither) +#if !MIN_VERSION_base(4, 13, 0)+import Control.Monad.Fail (MonadFail)+#endif  -- |The data types that can be interpreted or parsed to/from 'PackStream' 'ByteString' class PackStreamValue a where
src/Data/PackStream/Internal/Binary.hs view
@@ -3,7 +3,7 @@ {-# LANGUAGE FlexibleContexts #-} module Data.PackStream.Internal.Binary where -import Data.PackStream.Internal.Type ( PackStream, PackStreamError(..) )+import Data.PackStream.Internal.Type (PackStreamError(..))  import Data.ByteString (ByteString) import qualified Data.ByteString as BS (length)@@ -11,9 +11,9 @@ import Data.Binary (Binary, encode, decode) import Data.Binary.IEEE754 (wordToDouble, doubleToWord) import Data.Text (Text)-import Data.Int (Int, Int8, Int16, Int32, Int64)+import Data.Int (Int8, Int16, Int32, Int64) import Control.Applicative (liftA2)-import Data.Word (Word, Word8, Word16, Word32, Word64)+import Data.Word (Word8, Word16, Word32, Word64) import Control.Monad.Except (throwError, MonadError) import Data.Text.Encoding (decodeUtf8, encodeUtf8) 
src/Data/PackStream/Internal/Hex.hs view
@@ -10,7 +10,7 @@ import qualified Data.ByteString.Char8      as B import qualified Data.ByteString.Lazy.Char8 as L #if !MIN_VERSION_base(4, 13, 0)-import           Control.Monad.Fail (MonadFail)+import Control.Monad.Fail (MonadFail) #endif  -- | Convert strings into hexadecimal and back.
src/Data/PackStream/Parser.hs view
@@ -19,7 +19,7 @@ import Data.Binary (Word8) import Control.Monad.State ( gets, modify ) import Control.Monad.Except (throwError)-import Control.Monad (replicateM, (>=>))+import Control.Monad (replicateM)   -- |Parse '()'
src/Data/PackStream/Serializer.hs view
@@ -17,7 +17,7 @@ import Data.Text (Text) import Data.Text.Encoding (encodeUtf8) import Data.Map.Strict (Map, toList)-import Data.Word (Word8, Word)+import Data.Word (Word8)   -- |Represent '()' as 'PackStream' 'ByteString'
src/Data/PackStream/Structure.hs view
@@ -3,9 +3,9 @@ module Data.PackStream.Structure ( ToStructure (..), FromStructure (..) , Node (..), Relationship (..), UnboundRelationship (..), Path (..)-, Date (..), Time (..), LocalTime (..), DateTime (..), DateTimeZoneId (..), LocalDateTime (..)-, Duration (..)-, Point2D (..), Point3D (..)+-- , Date (..), Time (..), LocalTime (..), DateTime (..), DateTimeZoneId (..), LocalDateTime (..)+-- , Duration (..)+-- , Point2D (..), Point3D (..) ) where  import Data.Text (Text)@@ -14,7 +14,6 @@ import Control.Monad ((>=>))  import Data.PackStream.Internal.Type-import Data.PackStream ( PackStreamValue(..) )  -- * Structure coverters -- @@ -108,6 +107,7 @@     fromStructure (Structure 0x50 [L nds, L rls, L is]) = Path <$> traverse (fromValue >=> fromStructure) nds                                                                 <*> traverse (fromValue >=> fromStructure) rls                                                                 <*> traverse fromValue is+    fromStructure _                                     = throwError $ WrongStructure "Path"  -- |The days are days since the Unix epoch newtype Date = Date { days :: Int -- ^The days are days since the Unix epoch@@ -121,11 +121,11 @@   fromStructure (Structure 0x44 [I ds]) = pure $ Date ds   fromStructure _                       = throwError $ WrongStructure "Date" -data Time-data LocalTime-data DateTime-data DateTimeZoneId-data LocalDateTime-data Duration-data Point2D-data Point3D+-- data Time+-- data LocalTime+-- data DateTime+-- data DateTimeZoneId+-- data LocalDateTime+-- data Duration+-- data Point2D+-- data Point3D
test/Spec.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE CPP #-}  import Test.Hspec import Data.Text (Text)@@ -8,6 +9,10 @@ import Data.ByteString.Lazy (toStrict, fromStrict) import Data.Map.Strict (Map) import qualified Data.Map.Strict as M (empty, fromList)++#if !MIN_VERSION_base(4, 13, 0)+import Control.Monad.Fail (MonadFail)+#endif  import Data.PackStream (PackStreamValue (..), Value(..), (=:), unpackFail) import Data.PackStream.Internal.Hex (Hex(..))