Skip to content

Commit 71f71a5

Browse files
committed
Add tentative support for upcoming&unreleased base-4.13.0.0
NB: `Stream` is an internal monad and so we don't need to bother with the `fail` compat package.
1 parent b4a96fd commit 71f71a5

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

Codec/Compression/Zlib/Stream.hsc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ import Data.ByteString (ByteString)
123123
import Control.Applicative (Applicative(..))
124124
#endif
125125
import Control.Monad (ap,liftM)
126+
#if MIN_VERSION_base(4,9,0)
127+
import qualified Control.Monad.Fail as Fail
128+
#endif
126129
#if __GLASGOW_HASKELL__ >= 702
127130
#if __GLASGOW_HASKELL__ >= 708
128131
import Control.Monad.ST.Strict
@@ -373,8 +376,21 @@ instance Monad Stream where
373376
(>>=) = thenZ
374377
-- m >>= f = (m `thenZ` \a -> consistencyCheck `thenZ_` returnZ a) `thenZ` f
375378
(>>) = (*>)
379+
380+
#if !MIN_VERSION_base(4,8,0)
376381
return = pure
382+
#endif
383+
384+
#if !MIN_VERSION_base(4,9,0)
377385
fail = (finalise >>) . failZ
386+
#elif !MIN_VERSION_base(4,13,0)
387+
fail = Fail.fail
388+
#endif
389+
390+
#if MIN_VERSION_base(4,9,0)
391+
instance Fail.MonadFail Stream where
392+
fail = (finalise >>) . failZ
393+
#endif
378394

379395
returnZ :: a -> Stream a
380396
returnZ a = Z $ \_ inBuf outBuf outOffset outLength ->

changelog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.6.2.1 TBD
2+
3+
* Add support for GHC 8.8 / base-4.13
4+
15
0.6.2 Herbert Valerio Riedel <[email protected]> March 2018
26

37
* New cabal flag 'pkg-config' for discovering 'zlib` via pkg-config(1) (#16)

zlib.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: zlib
2-
version: 0.6.2
2+
version: 0.6.2.1
33
copyright: (c) 2006-2016 Duncan Coutts
44
license: BSD3
55
license-file: LICENSE

0 commit comments

Comments
 (0)