pipes-binary 0.4.3 → 0.4.4
raw patch · 5 files changed
+19/−19 lines, 5 filessetup-changed
Files
- LICENSE +1/−1
- Setup.hs +0/−4
- changelog.md +6/−1
- pipes-binary.cabal +2/−2
- src/Pipes/Binary.hs +10/−11
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2013-2018, Renzo Carbonara+Copyright (c) 2013, Renzo Carbonara All rights reserved.
− Setup.hs
@@ -1,4 +0,0 @@-#! /usr/bin/env nix-shell-#! nix-shell ./shell.nix -i runghc-import Distribution.Simple-main = defaultMain
changelog.md view
@@ -1,8 +1,13 @@+# Version 0.4.4++* Support `transformers >= 0.7.0`.++ # Version 0.4.3 * Builds with GHC 9.0.1. -* `Producer'` replaced with `Proxy`. See `pipes` +* `Producer'` replaced with `Proxy`. See `pipes` issue #224. * Use QuickCheck instead of SmallCheck for tests.
pipes-binary.cabal view
@@ -1,8 +1,8 @@ name: pipes-binary-version: 0.4.3+version: 0.4.4 license: BSD3 license-file: LICENSE-copyright: Copyright (c) Renzo Carbonara 2013-2021+copyright: Copyright (c) Renzo Carbonara 2013 author: Renzo Carbonara maintainer: renλren.zone stability: Experimental
src/Pipes/Binary.hs view
@@ -10,6 +10,7 @@ -- type Lens' a b = forall f . 'Functor' f => (b -> f b) -> (a -> f a) -- @ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RankNTypes #-}@@ -46,7 +47,9 @@ ) where import Control.Exception (Exception)+#if !MIN_VERSION_transformers(0,6,0) import Control.Monad.Trans.Error (Error)+#endif import qualified Control.Monad.Trans.State.Strict as S import Data.Binary (Binary (..)) import qualified Data.Binary@@ -86,10 +89,7 @@ -- @ encode :: (Monad m, Binary a) => a -> Proxy x' x () ByteString m () encode = encodePut . put-{-# INLINABLE encode #-}-{-# RULES "p >-> for cat encode" forall p .- p >-> for cat encode = for p (\a -> encodePut (put a))- #-}+{-# INLINE encode #-} -- | Like 'encode', except this uses an explicit 'Put'. --@@ -98,10 +98,7 @@ -- @ encodePut :: (Monad m) => Put -> Proxy x' x () ByteString m () encodePut = \p -> Pipes.ByteString.fromLazy (Put.runPut p)-{-# INLINABLE encodePut #-}-{-# RULES "p >-> for cat encodePut" forall p.- p >-> for cat encodePut = for p encodePut- #-}+{-# INLINE encodePut #-} -------------------------------------------------------------------------------- @@ -112,7 +109,7 @@ return (case x of Left e -> Left e Right (_, a) -> Right a)-{-# INLINABLE decode #-}+{-# INLINE decode #-} -- | /Improper lens/ that turns a stream of bytes into a stream of decoded -- values.@@ -155,7 +152,7 @@ :: (Monad m, Binary a) => Parser ByteString m (Either DecodingError (ByteOffset, a)) decodeL = decodeGetL get-{-# INLINABLE decodeL #-}+{-# INLINE decodeL #-} -- | Like 'decoded', except this tags each decoded value with the length of -- input consumed in order to decode it.@@ -192,7 +189,7 @@ return (case x of Left e -> Left e Right (_, a) -> Right a)-{-# INLINABLE decodeGet #-}+{-# INLINE decodeGet #-} -- | Like 'decodeL', except this requires an explicit 'Get' instead of any -- 'Binary' instance.@@ -222,7 +219,9 @@ } deriving (Show, Read, Eq, Data, Typeable, Generic) instance Exception DecodingError+#if !MIN_VERSION_transformers(0,6,0) instance Error DecodingError+#endif -------------------------------------------------------------------------------- -- Internal stuff