summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Todaro <solpeth@posteo.org>2020-09-09 10:25:20 +1000
committerSergei Trofimovich <slyfox@gentoo.org>2020-09-09 08:55:27 +0100
commitf3b0a091b34642ff5df1b57430bc5d7ff89eddbd (patch)
tree6fe34471656bb9659283654344236496b1f14277
parentdev-haskell/base64-bytestring: drop old (diff)
downloadgentoo-f3b0a091b34642ff5df1b57430bc5d7ff89eddbd.tar.gz
gentoo-f3b0a091b34642ff5df1b57430bc5d7ff89eddbd.tar.bz2
gentoo-f3b0a091b34642ff5df1b57430bc5d7ff89eddbd.zip
dev-haskell/logict-state: build with ghc-8.8
Closes: https://bugs.gentoo.org/736098 Package-Manager: Portage-3.0.6, Repoman-3.0.1 Signed-off-by: Jack Todaro <solpeth@posteo.org> Closes: https://github.com/gentoo/gentoo/pull/17478 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r--dev-haskell/logict-state/files/logict-state-0.1.0.5-monadfail-compat.patch64
-rw-r--r--dev-haskell/logict-state/logict-state-0.1.0.5.ebuild6
2 files changed, 68 insertions, 2 deletions
diff --git a/dev-haskell/logict-state/files/logict-state-0.1.0.5-monadfail-compat.patch b/dev-haskell/logict-state/files/logict-state-0.1.0.5-monadfail-compat.patch
new file mode 100644
index 000000000000..3da6f26e0dd4
--- /dev/null
+++ b/dev-haskell/logict-state/files/logict-state-0.1.0.5-monadfail-compat.patch
@@ -0,0 +1,64 @@
+diff --git a/src/Control/Monad/LogicState.hs b/src/Control/Monad/LogicState.hs
+index 93be8aa..613a77c 100644
+--- a/src/Control/Monad/LogicState.hs
++++ b/src/Control/Monad/LogicState.hs
+@@ -1,4 +1,4 @@
+-{-# LANGUAGE UndecidableInstances, Rank2Types, FlexibleInstances, FlexibleContexts, GADTs, ScopedTypeVariables, FunctionalDependencies #-}
++{-# LANGUAGE UndecidableInstances, Rank2Types, FlexibleInstances, FlexibleContexts, GADTs, ScopedTypeVariables, FunctionalDependencies, CPP #-}
+
+ -------------------------------------------------------------------------
+ -- |
+@@ -39,6 +39,9 @@ import Control.Applicative
+
+ import Control.Monad
+ import Control.Monad.Identity
++#if !MIN_VERSION_base(4,11,0)
++import qualified Control.Monad.Fail as Fail
++#endif
+ import Control.Monad.Trans
+
+ import Control.Monad.State
+@@ -83,7 +86,12 @@ instance Applicative (LogicStateT gs bs f) where
+ instance Monad (LogicStateT gs bs m) where
+ return a = LogicStateT ($ a)
+ m >>= f = LogicStateT $ \sk -> unLogicStateT m (\a -> unLogicStateT (f a) sk)
+- fail _ = LogicStateT $ flip const
++#if !MIN_VERSION_base(4,11,0)
++ fail = Fail.fail
++#endif
++
++instance MonadFail (LogicStateT gs bs m) where
++ fail _ = LogicStateT $ flip const
+
+ instance Alternative (LogicStateT gs bs f) where
+ empty = LogicStateT $ flip const
+diff --git a/src/Control/Monad/TransLogicState/Class.hs b/src/Control/Monad/TransLogicState/Class.hs
+index 4fa61c4..267704a 100644
+--- a/src/Control/Monad/TransLogicState/Class.hs
++++ b/src/Control/Monad/TransLogicState/Class.hs
+@@ -1,4 +1,4 @@
+-{-# LANGUAGE ScopedTypeVariables #-}
++{-# LANGUAGE ScopedTypeVariables, CPP #-}
+
+ module Control.Monad.TransLogicState.Class
+ ( TransLogicState(..)
+@@ -15,12 +15,19 @@ import Control.Arrow
+ import Control.Monad.Identity
+ -- import Control.Monad.Trans
+
++instance MonadFail Identity where
++ fail msg = runIdentity $ fail msg
++
+ -- | Additions to MonadTrans specifically useful for LogicState
+ class {- MonadTrans t => -} TransLogicState s t where
+ -------------------------------------------------------------------------
+ -- | Extracts the first result from a 't m' computation,
+ -- failing otherwise.
++#if !MIN_VERSION_base(4,13,0)
+ observeT :: (Monad m) => s -> t m a -> m a
++#else
++ observeT :: (MonadFail m) => s -> t m a -> m a
++#endif
+ observeT e m = fmap head $ observeManyT e 1 m
+
+ -------------------------------------------------------------------------
diff --git a/dev-haskell/logict-state/logict-state-0.1.0.5.ebuild b/dev-haskell/logict-state/logict-state-0.1.0.5.ebuild
index 86cad39395b7..519433782076 100644
--- a/dev-haskell/logict-state/logict-state-0.1.0.5.ebuild
+++ b/dev-haskell/logict-state/logict-state-0.1.0.5.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
# ebuild generated by hackport 0.5.6.9999
@@ -24,3 +24,5 @@ RDEPEND=">=dev-haskell/logict-0.6.0.2:=[profile?]
DEPEND="${RDEPEND}
>=dev-haskell/cabal-1.22.2.0
"
+
+PATCHES=( "${FILESDIR}"/${P}-monadfail-compat.patch )