From 6c4c6c9e3249ac76378f8ad16b48ccec5f253c89 Mon Sep 17 00:00:00 2001 From: Christopher Sasarak Date: Fri, 17 Feb 2023 16:22:35 -0600 Subject: [PATCH] Increase ranges for bytestring and base. Fix warnings re: pure/return. --- Codec/Compression/BZip/Stream.hsc | 13 +++++++------ bzlib.cabal | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Codec/Compression/BZip/Stream.hsc b/Codec/Compression/BZip/Stream.hsc index dcc7d12..127c574 100644 --- a/Codec/Compression/BZip/Stream.hsc +++ b/Codec/Compression/BZip/Stream.hsc @@ -228,14 +228,15 @@ instance Functor Stream where fmap = liftM instance Applicative Stream where - pure = return + pure = pureZ (<*>) = ap + (*>) = thenZ_ instance Monad Stream where (>>=) = thenZ -- m >>= f = (m `thenZ` \a -> consistencyCheck `thenZ_` returnZ a) `thenZ` f - (>>) = thenZ_ - return = returnZ + (>>) = (*>) + return = pure #if !MIN_VERSION_base(4,13,0) fail = Fail.fail #endif @@ -243,10 +244,10 @@ instance Monad Stream where instance Fail.MonadFail Stream where fail = (finalise >>) . failZ -returnZ :: a -> Stream a -returnZ a = BZ $ \_ inBuf outBuf outOffset outLength -> +pureZ :: a -> Stream a +pureZ a = BZ $ \_ inBuf outBuf outOffset outLength -> return (inBuf, outBuf, outOffset, outLength, a) -{-# INLINE returnZ #-} +{-# INLINE pureZ #-} thenZ :: Stream a -> (a -> Stream b) -> Stream b thenZ (BZ m) f = diff --git a/bzlib.cabal b/bzlib.cabal index 13b167a..a8979c2 100644 --- a/bzlib.cabal +++ b/bzlib.cabal @@ -1,5 +1,5 @@ name: bzlib -version: 0.5.1.0 +version: 0.6.0.0 copyright: (c) 2006-2015 Duncan Coutts license: BSD3 license-file: LICENSE @@ -30,7 +30,7 @@ source-repository head source-repository this type: git location: https://github.com/hackage-trustees/bzlib.git - tag: 0.5.1.0 + tag: 0.6.0.0 library default-language: Haskell2010 @@ -38,8 +38,8 @@ library Codec.Compression.BZip.Internal other-modules: Codec.Compression.BZip.Stream default-extensions: CPP, ForeignFunctionInterface - build-depends: base >= 4.3 && < 4.16, - bytestring == 0.9.* || == 0.10.* + build-depends: base >= 4.3 && < 5, + bytestring >= 0.9.0 && < 0.12 if !impl(ghc >=8.0) build-depends: fail ==4.9.* includes: bzlib.h