summaryrefslogtreecommitdiff
path: root/dev-haskell/logict-state
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-09-16 09:32:48 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-09-16 09:32:48 +0100
commit9ee6d97c2883d42f204a533a8bc1f4562df778fb (patch)
treeb690ddc0ca30f1472887edbb0b8313629bfcbbb2 /dev-haskell/logict-state
parentb17a3ef12038de50228bade1f05502c74e135321 (diff)
gentoo resync : 16.09.2020
Diffstat (limited to 'dev-haskell/logict-state')
-rw-r--r--dev-haskell/logict-state/Manifest3
-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
3 files changed, 70 insertions, 3 deletions
diff --git a/dev-haskell/logict-state/Manifest b/dev-haskell/logict-state/Manifest
index e782ffce4b49..d823a4ddd07c 100644
--- a/dev-haskell/logict-state/Manifest
+++ b/dev-haskell/logict-state/Manifest
@@ -1,3 +1,4 @@
+AUX logict-state-0.1.0.5-monadfail-compat.patch 2447 BLAKE2B a6decde86f3993e00e55e3298e25347ce2fbd43b38bda91de00b828267c20e8ec53f98c64e7ee4f25a65d44eaf18b462b354b2eca97430779688007bd551228c SHA512 5c237951869ae09b7b1e0c82d39e9d50949ff53dab7afdd51fe081dbed412e29e4c3875e5d446bb81b426e53e158ba9977beaf2abe54b61c412c2fc8c91cf5fb
DIST logict-state-0.1.0.5.tar.gz 4525 BLAKE2B 9dbd41d4b1f1f9023082836a852bc3f2d273f920db6caa4383fc23c967e588dcb2e94b053a5c7a3fb3c28afbd714f7006583a65dd87c3eb3b535202caf2223fc SHA512 f641907213c23de22a779f1dd065aa3c02de5686dae0fac86403d958ba6d2cba23d86d6a43b8c78fff0963f7ed62837d704243eeac006163eb6fa2ab26fe9ad4
-EBUILD logict-state-0.1.0.5.ebuild 652 BLAKE2B b7296de9f4ad475a6895f2bf0bc4711fdeec05512ebf9713c561045465fb34935dca0fb10add770f388eeace6bcad8fd41b526d87d5e162d0168c75cc0968283 SHA512 f06bb68fcaca8e9c4f2c963c754595797840f329f6bef7bdb0c86e9d965a12e9c7d5e17d033c86c54a4d35be9b0026b7061e6d7cc7e9a2e07f44d87925c81880
+EBUILD logict-state-0.1.0.5.ebuild 707 BLAKE2B 79c1fb80c5e47f31cda599c061421ac2db65a8e1cf5610855cee329daddb723fb480fae92597ea95d4d4dc1642833925dabcf85d79c1416cbf6e06fb602d42f2 SHA512 5bf998460f9443947b6261acc5ebb8db82c1c78c03a712069a1207193968ce27040dc180c67d16576da115c28fff2ae1799f8713830394570e919673ba5baa05
MISC metadata.xml 489 BLAKE2B 7155624f2570bd9e09434734cf702db4785da809af5f1a37d71c831109aeb4eb1d60db8fb9e12043fc7b564deb6255e076a47126d9bf5c82c1a73c14ffc71349 SHA512 a240b1ef1ef72e87f57d27217359e2f5e6494cc0884b25b605b66ba9ab06182be8e8f815e73fa49a44961b958e8d00e0d4daf3cf58f20e7210ea531f6ab848fa
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 )