Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-haskell/logict-state/files/, dev-haskell/logict-state/
Date: Wed, 09 Sep 2020 07:55:39
Message-Id: 1599638127.f3b0a091b34642ff5df1b57430bc5d7ff89eddbd.slyfox@gentoo
1 commit: f3b0a091b34642ff5df1b57430bc5d7ff89eddbd
2 Author: Jack Todaro <solpeth <AT> posteo <DOT> org>
3 AuthorDate: Wed Sep 9 00:25:20 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 9 07:55:27 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3b0a091
7
8 dev-haskell/logict-state: build with ghc-8.8
9
10 Closes: https://bugs.gentoo.org/736098
11 Package-Manager: Portage-3.0.6, Repoman-3.0.1
12 Signed-off-by: Jack Todaro <solpeth <AT> posteo.org>
13 Closes: https://github.com/gentoo/gentoo/pull/17478
14 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
15
16 .../logict-state-0.1.0.5-monadfail-compat.patch | 64 ++++++++++++++++++++++
17 .../logict-state/logict-state-0.1.0.5.ebuild | 6 +-
18 2 files changed, 68 insertions(+), 2 deletions(-)
19
20 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
21 new file mode 100644
22 index 00000000000..3da6f26e0dd
23 --- /dev/null
24 +++ b/dev-haskell/logict-state/files/logict-state-0.1.0.5-monadfail-compat.patch
25 @@ -0,0 +1,64 @@
26 +diff --git a/src/Control/Monad/LogicState.hs b/src/Control/Monad/LogicState.hs
27 +index 93be8aa..613a77c 100644
28 +--- a/src/Control/Monad/LogicState.hs
29 ++++ b/src/Control/Monad/LogicState.hs
30 +@@ -1,4 +1,4 @@
31 +-{-# LANGUAGE UndecidableInstances, Rank2Types, FlexibleInstances, FlexibleContexts, GADTs, ScopedTypeVariables, FunctionalDependencies #-}
32 ++{-# LANGUAGE UndecidableInstances, Rank2Types, FlexibleInstances, FlexibleContexts, GADTs, ScopedTypeVariables, FunctionalDependencies, CPP #-}
33 +
34 + -------------------------------------------------------------------------
35 + -- |
36 +@@ -39,6 +39,9 @@ import Control.Applicative
37 +
38 + import Control.Monad
39 + import Control.Monad.Identity
40 ++#if !MIN_VERSION_base(4,11,0)
41 ++import qualified Control.Monad.Fail as Fail
42 ++#endif
43 + import Control.Monad.Trans
44 +
45 + import Control.Monad.State
46 +@@ -83,7 +86,12 @@ instance Applicative (LogicStateT gs bs f) where
47 + instance Monad (LogicStateT gs bs m) where
48 + return a = LogicStateT ($ a)
49 + m >>= f = LogicStateT $ \sk -> unLogicStateT m (\a -> unLogicStateT (f a) sk)
50 +- fail _ = LogicStateT $ flip const
51 ++#if !MIN_VERSION_base(4,11,0)
52 ++ fail = Fail.fail
53 ++#endif
54 ++
55 ++instance MonadFail (LogicStateT gs bs m) where
56 ++ fail _ = LogicStateT $ flip const
57 +
58 + instance Alternative (LogicStateT gs bs f) where
59 + empty = LogicStateT $ flip const
60 +diff --git a/src/Control/Monad/TransLogicState/Class.hs b/src/Control/Monad/TransLogicState/Class.hs
61 +index 4fa61c4..267704a 100644
62 +--- a/src/Control/Monad/TransLogicState/Class.hs
63 ++++ b/src/Control/Monad/TransLogicState/Class.hs
64 +@@ -1,4 +1,4 @@
65 +-{-# LANGUAGE ScopedTypeVariables #-}
66 ++{-# LANGUAGE ScopedTypeVariables, CPP #-}
67 +
68 + module Control.Monad.TransLogicState.Class
69 + ( TransLogicState(..)
70 +@@ -15,12 +15,19 @@ import Control.Arrow
71 + import Control.Monad.Identity
72 + -- import Control.Monad.Trans
73 +
74 ++instance MonadFail Identity where
75 ++ fail msg = runIdentity $ fail msg
76 ++
77 + -- | Additions to MonadTrans specifically useful for LogicState
78 + class {- MonadTrans t => -} TransLogicState s t where
79 + -------------------------------------------------------------------------
80 + -- | Extracts the first result from a 't m' computation,
81 + -- failing otherwise.
82 ++#if !MIN_VERSION_base(4,13,0)
83 + observeT :: (Monad m) => s -> t m a -> m a
84 ++#else
85 ++ observeT :: (MonadFail m) => s -> t m a -> m a
86 ++#endif
87 + observeT e m = fmap head $ observeManyT e 1 m
88 +
89 + -------------------------------------------------------------------------
90
91 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
92 index 86cad39395b..51943378207 100644
93 --- a/dev-haskell/logict-state/logict-state-0.1.0.5.ebuild
94 +++ b/dev-haskell/logict-state/logict-state-0.1.0.5.ebuild
95 @@ -1,7 +1,7 @@
96 -# Copyright 1999-2019 Gentoo Authors
97 +# Copyright 1999-2020 Gentoo Authors
98 # Distributed under the terms of the GNU General Public License v2
99
100 -EAPI=6
101 +EAPI=7
102
103 # ebuild generated by hackport 0.5.6.9999
104
105 @@ -24,3 +24,5 @@ RDEPEND=">=dev-haskell/logict-0.6.0.2:=[profile?]
106 DEPEND="${RDEPEND}
107 >=dev-haskell/cabal-1.22.2.0
108 "
109 +
110 +PATCHES=( "${FILESDIR}"/${P}-monadfail-compat.patch )