Skip to content

Commit 05818ce

Browse files
committed
add support for ghc >=8.8 and associated monad fail changes.
1 parent 3d5d860 commit 05818ce

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Data/Vector.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ import Control.DeepSeq ( NFData, rnf )
173173
import Control.Monad ( MonadPlus(..), liftM, ap )
174174
import Control.Monad.ST ( ST )
175175
import Control.Monad.Primitive
176-
176+
import qualified Control.Monad.Fail as Fail
177177

178178
import Control.Monad.Zip
179179

@@ -340,7 +340,12 @@ instance Monad Vector where
340340

341341
{-# INLINE (>>=) #-}
342342
(>>=) = flip concatMap
343+
#if !(MIN_VERSION_base(4,13,0))
344+
{-# INLINE fail #-}
345+
fail _= empty
346+
#endif
343347

348+
instance Fail.MonadFail Vector where
344349
{-# INLINE fail #-}
345350
fail _ = empty
346351

changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Changes in version 0.12.0.3
2+
* Add support for ghc >=8.8 monad fail
13
Changes in version 0.12.0.2
24
* Fixes issue #220, compact heap operations crashing on boxed vectors constructed
35
using traverse.

vector.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: vector
2-
Version: 0.12.0.2
2+
Version: 0.12.0.3
33
-- don't forget to update the changelog file!
44
License: BSD3
55
License-File: LICENSE
@@ -149,7 +149,8 @@ Library
149149
, ghc-prim >= 0.2 && < 0.6
150150
, deepseq >= 1.1 && < 1.5
151151
if !impl(ghc > 8.0)
152-
Build-Depends: semigroups >= 0.18 && < 0.19
152+
Build-Depends: fail == 4.9.*
153+
, semigroups >= 0.18 && < 0.19
153154

154155
Ghc-Options: -O2 -Wall
155156

0 commit comments

Comments
 (0)