Skip to content

Commit

Permalink
Add tentative support for upcoming&unreleased base-4.13.0.0
Browse files Browse the repository at this point in the history
NB: `Stream` is an internal monad and so we don't need to bother with
the `fail` compat package.
  • Loading branch information
hvr committed May 1, 2019
1 parent b4a96fd commit 71f71a5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Codec/Compression/Zlib/Stream.hsc
Expand Up @@ -123,6 +123,9 @@ import Data.ByteString (ByteString)
import Control.Applicative (Applicative(..))
#endif
import Control.Monad (ap,liftM)
#if MIN_VERSION_base(4,9,0)
import qualified Control.Monad.Fail as Fail
#endif
#if __GLASGOW_HASKELL__ >= 702
#if __GLASGOW_HASKELL__ >= 708
import Control.Monad.ST.Strict
Expand Down Expand Up @@ -373,8 +376,21 @@ instance Monad Stream where
(>>=) = thenZ
-- m >>= f = (m `thenZ` \a -> consistencyCheck `thenZ_` returnZ a) `thenZ` f
(>>) = (*>)

#if !MIN_VERSION_base(4,8,0)
return = pure
#endif

#if !MIN_VERSION_base(4,9,0)
fail = (finalise >>) . failZ
#elif !MIN_VERSION_base(4,13,0)
fail = Fail.fail
#endif

#if MIN_VERSION_base(4,9,0)
instance Fail.MonadFail Stream where
fail = (finalise >>) . failZ
#endif

returnZ :: a -> Stream a
returnZ a = Z $ \_ inBuf outBuf outOffset outLength ->
Expand Down
4 changes: 4 additions & 0 deletions changelog
@@ -1,3 +1,7 @@
0.6.2.1 TBD

* Add support for GHC 8.8 / base-4.13

0.6.2 Herbert Valerio Riedel <hvr@gnu.org> March 2018

* New cabal flag 'pkg-config' for discovering 'zlib` via pkg-config(1) (#16)
Expand Down
2 changes: 1 addition & 1 deletion zlib.cabal
@@ -1,5 +1,5 @@
name: zlib
version: 0.6.2
version: 0.6.2.1
copyright: (c) 2006-2016 Duncan Coutts
license: BSD3
license-file: LICENSE
Expand Down

0 comments on commit 71f71a5

Please sign in to comment.