io-streams 1.5.2.1 → 1.5.2.2
raw patch · 2 files changed
+35/−13 lines, 2 filesdep ~basedep ~bytestringdep ~deepseqPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, bytestring, deepseq, network, primitive, text, time, vector, zlib
API changes (from Hackage documentation)
Files
- io-streams.cabal +20/−9
- src/System/IO/Streams/Vector.hs +15/−4
io-streams.cabal view
@@ -1,5 +1,5 @@ Name: io-streams-Version: 1.5.2.1+Version: 1.5.2.2 License: BSD3 License-file: LICENSE Category: Data, Network, IO-Streams@@ -7,9 +7,20 @@ Maintainer: Gregory Collins <greg@gregorycollins.net> Cabal-version: >= 1.10 Synopsis: Simple, composable, and easy-to-use stream I/O-Tested-With: GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.3,- GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.3,- GHC==8.8.3, GHC==8.10.1, GHC==9.0.1+Tested-With:+ GHC == 9.4.1+ GHC == 9.2.4+ GHC == 9.0.2+ GHC == 8.10.7+ GHC == 8.8.4+ GHC == 8.6.5+ GHC == 8.4.4+ GHC == 8.2.2+ GHC == 8.0.2+ GHC == 7.10.3+ GHC == 7.8.4+ GHC == 7.6.3+ GHC == 7.4.2 Bug-Reports: https://github.com/snapframework/io-streams/issues Description:@@ -128,14 +139,14 @@ System.IO.Streams.Internal.Search Build-depends: base >= 4 && <5,- attoparsec >= 0.10 && <0.14,+ attoparsec >= 0.10 && <0.15, bytestring >= 0.9 && <0.12, primitive >= 0.2 && <0.8, process >= 1.1 && <1.7,- text >= 0.10 && <1.3,- time >= 1.2 && <1.10,- transformers >= 0.2 && <0.6,- vector >= 0.7 && <0.13+ text >=0.10 && <1.3 || >= 2.0 && <2.1,+ time >= 1.2 && <1.13,+ transformers >= 0.2 && <0.7,+ vector >= 0.7 && <0.14 if !impl(ghc >= 7.8) Build-depends: bytestring-builder >= 0.10 && <0.11
src/System/IO/Streams/Vector.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-}+{-# LANGUAGE CPP #-} -- | Vector conversions and utilities. @@ -29,7 +30,7 @@ import Control.Concurrent.MVar (modifyMVar, modifyMVar_, newMVar) import Control.Monad (liftM, (>=>)) import Control.Monad.IO.Class (MonadIO (..))-import Control.Monad.Primitive (PrimState (..))+import Control.Monad.Primitive (PrimState (..), RealWorld) import Data.IORef (IORef, newIORef, readIORef, writeIORef) import Data.Vector.Generic (Vector (..)) import qualified Data.Vector.Generic as V@@ -38,7 +39,17 @@ import System.IO.Streams.Internal (InputStream, OutputStream, fromGenerator, yield) import qualified System.IO.Streams.Internal as S +#if MIN_VERSION_vector(0,13,0)+import Control.Monad.ST (stToIO)+#endif +basicUnsafeFreezeCompat :: Vector v a => V.Mutable v RealWorld a -> IO (v a)+#if MIN_VERSION_vector(0,13,0)+basicUnsafeFreezeCompat = stToIO . V.basicUnsafeFreeze+#else+basicUnsafeFreezeCompat = V.basicUnsafeFreeze+#endif+ ------------------------------------------------------------------------------ -- | Transforms a vector into an 'InputStream' that yields each of the values -- in the vector in turn.@@ -77,7 +88,7 @@ -- | Like 'toVector', but allows control over how large the vector buffer is to -- start with. toVectorSized :: Vector v a => Int -> InputStream a -> IO (v a)-toVectorSized n = toMutableVectorSized n >=> V.basicUnsafeFreeze+toVectorSized n = toMutableVectorSized n >=> basicUnsafeFreezeCompat {-# INLINE toVectorSized #-} @@ -136,7 +147,7 @@ vectorOutputStreamSized :: Vector v c => Int -> IO (OutputStream c, IO (v c)) vectorOutputStreamSized n = do (os, flush) <- mutableVectorOutputStreamSized n- return $! (os, flush >>= V.basicUnsafeFreeze)+ return $! (os, flush >>= basicUnsafeFreezeCompat) ------------------------------------------------------------------------------@@ -291,7 +302,7 @@ Int -> (OutputStream a -> IO b) -> IO (v a)-outputToVectorSized n = outputToMutableVectorSized n >=> V.basicUnsafeFreeze+outputToVectorSized n = outputToMutableVectorSized n >=> basicUnsafeFreezeCompat {-# INLINE outputToVectorSized #-}