1 |
commit: 48c2e16488fc4cc5135f177a6f349414cc659eeb |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 14 23:32:40 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 14 23:47:22 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48c2e164 |
7 |
|
8 |
dev-haskell/edisonapi: bump up to 1.3.1-r1 |
9 |
|
10 |
Package-Manager: Portage-2.3.81, Repoman-2.3.20 |
11 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
12 |
|
13 |
dev-haskell/edisonapi/edisonapi-1.3.1-r1.ebuild | 32 +++ |
14 |
.../edisonapi/files/edisonapi-1.3.1-ghc-8.8.patch | 298 +++++++++++++++++++++ |
15 |
2 files changed, 330 insertions(+) |
16 |
|
17 |
diff --git a/dev-haskell/edisonapi/edisonapi-1.3.1-r1.ebuild b/dev-haskell/edisonapi/edisonapi-1.3.1-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..6469f7fa542 |
20 |
--- /dev/null |
21 |
+++ b/dev-haskell/edisonapi/edisonapi-1.3.1-r1.ebuild |
22 |
@@ -0,0 +1,32 @@ |
23 |
+# Copyright 1999-2019 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+ |
28 |
+# ebuild generated by hackport 0.4.7.9999 |
29 |
+ |
30 |
+CABAL_FEATURES="lib profile haddock hoogle hscolour" |
31 |
+inherit haskell-cabal |
32 |
+ |
33 |
+MY_PN="EdisonAPI" |
34 |
+MY_P="${MY_PN}-${PV}" |
35 |
+ |
36 |
+DESCRIPTION="A library of efficient, purely-functional data structures (API)" |
37 |
+HOMEPAGE="http://rwd.rdockins.name/edison/home/" |
38 |
+SRC_URI="https://hackage.haskell.org/package/${MY_P}/${MY_P}.tar.gz" |
39 |
+ |
40 |
+LICENSE="MIT" |
41 |
+SLOT="0/${PV}" |
42 |
+KEYWORDS="~amd64 ~x86" |
43 |
+IUSE="" |
44 |
+ |
45 |
+RDEPEND=">=dev-haskell/mtl-1.0:=[profile?] |
46 |
+ >=dev-lang/ghc-7.4.1:= |
47 |
+" |
48 |
+DEPEND="${RDEPEND} |
49 |
+ >=dev-haskell/cabal-1.10 |
50 |
+" |
51 |
+ |
52 |
+S="${WORKDIR}/${MY_P}" |
53 |
+ |
54 |
+PATCHES=( "${FILESDIR}/${PN}-1.3.1-ghc-8.8.patch" ) |
55 |
|
56 |
diff --git a/dev-haskell/edisonapi/files/edisonapi-1.3.1-ghc-8.8.patch b/dev-haskell/edisonapi/files/edisonapi-1.3.1-ghc-8.8.patch |
57 |
new file mode 100644 |
58 |
index 00000000000..81035f31135 |
59 |
--- /dev/null |
60 |
+++ b/dev-haskell/edisonapi/files/edisonapi-1.3.1-ghc-8.8.patch |
61 |
@@ -0,0 +1,298 @@ |
62 |
+commit 8da6c0f7d8666766e2f0693425c347c0adb492dc |
63 |
+Author: Andrés Sicard-Ramírez <asr@×××××××××.co> |
64 |
+Date: Thu Jul 4 18:15:17 2019 -0500 |
65 |
+ |
66 |
+ Supported GHC 8.8.1. |
67 |
+ |
68 |
+ All changes were required by the MonadFail proposal. |
69 |
+ |
70 |
+diff --git a/EdisonAPI.cabal b/EdisonAPI.cabal |
71 |
+index 0f8f161..072cbd2 100644 |
72 |
+--- a/EdisonAPI.cabal |
73 |
++++ b/EdisonAPI.cabal |
74 |
+@@ -40,6 +40,8 @@ Library |
75 |
+ Build-Depends: |
76 |
+ base == 4.*, |
77 |
+ mtl >= 1.0 |
78 |
++ if impl(ghc < 8.0) |
79 |
++ build-depends: fail |
80 |
+ Default-Language: Haskell2010 |
81 |
+ Default-Extensions: |
82 |
+ MultiParamTypeClasses |
83 |
+diff --git a/src/Data/Edison/Assoc.hs b/src/Data/Edison/Assoc.hs |
84 |
+index fac1c59..3993dce 100644 |
85 |
+--- a/src/Data/Edison/Assoc.hs |
86 |
++++ b/src/Data/Edison/Assoc.hs |
87 |
+@@ -71,6 +71,8 @@ module Data.Edison.Assoc ( |
88 |
+ |
89 |
+ import Prelude hiding (null,map,lookup,foldr,foldl,foldr1,foldl1,filter) |
90 |
+ |
91 |
++import qualified Control.Monad.Fail as Fail |
92 |
++ |
93 |
+ import Data.Edison.Prelude |
94 |
+ |
95 |
+ import Data.Edison.Seq(Sequence) |
96 |
+@@ -212,7 +214,7 @@ class (Eq k,Functor m) => AssocX m k | m -> k where |
97 |
+ -- |
98 |
+ -- This function is /ambiguous/ at finite relation types if the key appears |
99 |
+ -- more than once in the finite relation. Otherwise, it is /unambiguous/. |
100 |
+- lookupM :: (Monad rm) => k -> m a -> rm a |
101 |
++ lookupM :: (Fail.MonadFail rm) => k -> m a -> rm a |
102 |
+ |
103 |
+ -- | Return all elements bound by the given key in an unspecified order. |
104 |
+ -- |
105 |
+@@ -236,7 +238,7 @@ class (Eq k,Functor m) => AssocX m k | m -> k where |
106 |
+ -- |
107 |
+ -- This function is /ambiguous/ at finite relation types if the key appears |
108 |
+ -- more than once in the finite relation. Otherwise, it is /unambiguous/. |
109 |
+- lookupAndDeleteM :: (Monad rm) => k -> m a -> rm (a, m a) |
110 |
++ lookupAndDeleteM :: (Fail.MonadFail rm) => k -> m a -> rm (a, m a) |
111 |
+ |
112 |
+ -- | Find all elements bound by the given key; return a sequence containing |
113 |
+ -- all such bound elements in an unspecified order and the collection |
114 |
+@@ -395,7 +397,7 @@ class (AssocX m k, Ord k) => OrdAssocX m k | m -> k where |
115 |
+ -- |
116 |
+ -- This function is /ambiguous/ at finite relation types if the finite relation |
117 |
+ -- contains more than one minimum key. Otherwise it is /unambiguous/. |
118 |
+- minView :: (Monad rm) => m a -> rm (a, m a) |
119 |
++ minView :: (Fail.MonadFail rm) => m a -> rm (a, m a) |
120 |
+ |
121 |
+ -- | Find the binding with the minimum key and return its element. Signals |
122 |
+ -- an error if the associative collection is empty. Which element is chosen |
123 |
+@@ -426,7 +428,7 @@ class (AssocX m k, Ord k) => OrdAssocX m k | m -> k where |
124 |
+ -- |
125 |
+ -- This function is /ambiguous/ at finite relation types if the finite relation |
126 |
+ -- contains more than one minimum key. Otherwise it is /unambiguous/. |
127 |
+- maxView :: (Monad rm) => m a -> rm (a, m a) |
128 |
++ maxView :: (Fail.MonadFail rm) => m a -> rm (a, m a) |
129 |
+ |
130 |
+ -- | Find the binding with the maximum key and return its element. Signals |
131 |
+ -- an error if the associative collection is empty. Which element is chosen |
132 |
+@@ -777,7 +779,7 @@ class (Assoc m k, OrdAssocX m k) => OrdAssoc m k | m -> k where |
133 |
+ -- minimum key exists in the relation. Furthermore, it is /ambiguous/ |
134 |
+ -- with respect to the actual key observed unless the @Eq@ instance on |
135 |
+ -- keys corresponds to indistinguisability. |
136 |
+- minViewWithKey :: (Monad rm) => m a -> rm ((k, a), m a) |
137 |
++ minViewWithKey :: (Fail.MonadFail rm) => m a -> rm ((k, a), m a) |
138 |
+ |
139 |
+ -- | Find the binding with the minimum key in an associative collection and |
140 |
+ -- return the key and the element. Signals an error if the associative |
141 |
+@@ -800,7 +802,7 @@ class (Assoc m k, OrdAssocX m k) => OrdAssoc m k | m -> k where |
142 |
+ -- maximum key exists in the relation. Furthermore, it is /ambiguous/ |
143 |
+ -- with respect to the actual key observed unless the @Eq@ instance on |
144 |
+ -- keys corresponds to indistinguisability. |
145 |
+- maxViewWithKey :: (Monad rm) => m a -> rm ((k, a), m a) |
146 |
++ maxViewWithKey :: (Fail.MonadFail rm) => m a -> rm ((k, a), m a) |
147 |
+ |
148 |
+ -- | Find the binding with the maximum key in an associative collection and |
149 |
+ -- return the key and the element. Signals an error if the associative |
150 |
+diff --git a/src/Data/Edison/Coll.hs b/src/Data/Edison/Coll.hs |
151 |
+index 88ae755..be4df08 100644 |
152 |
+--- a/src/Data/Edison/Coll.hs |
153 |
++++ b/src/Data/Edison/Coll.hs |
154 |
+@@ -97,6 +97,7 @@ module Data.Edison.Coll ( |
155 |
+ ) where |
156 |
+ |
157 |
+ import Prelude hiding (null,foldr,foldl,foldr1,foldl1,lookup,filter) |
158 |
++import qualified Control.Monad.Fail as Fail |
159 |
+ import Data.Monoid |
160 |
+ |
161 |
+ import Data.Edison.Prelude |
162 |
+@@ -421,7 +422,7 @@ class CollX c a => Coll c a | c -> a where |
163 |
+ -- This function is /ambiguous/ at bag types, when more than one |
164 |
+ -- element equivalent to the given item is in the bag. Otherwise |
165 |
+ -- it is /unambiguous/. |
166 |
+- lookupM :: (Monad m) => a -> c -> m a |
167 |
++ lookupM :: (Fail.MonadFail m) => a -> c -> m a |
168 |
+ |
169 |
+ -- | Return a sequence containing all elements in the collection equal to |
170 |
+ -- the given element in an unspecified order. |
171 |
+@@ -504,7 +505,7 @@ class (Coll c a, OrdCollX c a) => OrdColl c a | c -> a where |
172 |
+ -- |
173 |
+ -- This function is /ambiguous/ at bag types, if more than one minimum |
174 |
+ -- element exists in the bag. Otherwise, it is /unambiguous/. |
175 |
+- minView :: (Monad m) => c -> m (a, c) |
176 |
++ minView :: (Fail.MonadFail m) => c -> m (a, c) |
177 |
+ |
178 |
+ -- | Return the minimum element in the collection. If there are multiple |
179 |
+ -- copies of the minimum element, it is unspecified which is chosen. |
180 |
+@@ -523,7 +524,7 @@ class (Coll c a, OrdCollX c a) => OrdColl c a | c -> a where |
181 |
+ -- |
182 |
+ -- This function is /ambiguous/ at bag types, if more than one maximum |
183 |
+ -- element exists in the bag. Otherwise, it is /unambiguous/. |
184 |
+- maxView :: (Monad m) => c -> m (a, c) |
185 |
++ maxView :: (Fail.MonadFail m) => c -> m (a, c) |
186 |
+ |
187 |
+ -- | Return the maximum element in the collection. If there are multiple |
188 |
+ -- copies of the maximum element, it is unspecified which is chosen. |
189 |
+diff --git a/src/Data/Edison/Prelude.hs b/src/Data/Edison/Prelude.hs |
190 |
+index 2ac6968..8281f46 100644 |
191 |
+--- a/src/Data/Edison/Prelude.hs |
192 |
++++ b/src/Data/Edison/Prelude.hs |
193 |
+@@ -10,14 +10,19 @@ |
194 |
+ -- This module is a central depository of common definitions |
195 |
+ -- used throughout Edison. |
196 |
+ |
197 |
++{-# LANGUAGE GeneralizedNewtypeDeriving #-} |
198 |
++ |
199 |
+ module Data.Edison.Prelude ( |
200 |
+ -- * Hashing classes |
201 |
+ Hash (..) |
202 |
+ , UniqueHash |
203 |
+ , ReversibleHash (..) |
204 |
+ , Measured (..) |
205 |
++-- * Pure MonadFail |
206 |
++, runFail_ |
207 |
+ ) where |
208 |
+ |
209 |
++import Control.Monad.Fail |
210 |
+ import Data.Monoid |
211 |
+ |
212 |
+ -- | This class represents hashable objects. If obeys the |
213 |
+@@ -62,3 +67,14 @@ class UniqueHash a => ReversibleHash a where |
214 |
+ -- the computation. |
215 |
+ class (Monoid v) => Measured v a | a -> v where |
216 |
+ measure :: a -> v |
217 |
++ |
218 |
++-- From Agda source code: src/full/Agda/Utils/Fail.hs |
219 |
++-- | A pure MonadFail. |
220 |
++newtype Fail a = Fail { runFail :: Either String a } |
221 |
++ deriving (Functor, Applicative, Monad) |
222 |
++ |
223 |
++instance MonadFail Fail where |
224 |
++ fail = Fail . Left |
225 |
++ |
226 |
++runFail_ :: Fail a -> a |
227 |
++runFail_ = either error id . runFail |
228 |
+diff --git a/src/Data/Edison/Seq.hs b/src/Data/Edison/Seq.hs |
229 |
+index 78ca245..0394d58 100644 |
230 |
+--- a/src/Data/Edison/Seq.hs |
231 |
++++ b/src/Data/Edison/Seq.hs |
232 |
+@@ -58,6 +58,7 @@ import Prelude hiding (concat,reverse,map,concatMap,foldr,foldl,foldr1,foldl1, |
233 |
+ zip,zip3,zipWith,zipWith3,unzip,unzip3,null) |
234 |
+ |
235 |
+ import Control.Monad |
236 |
++import qualified Control.Monad.Fail as Fail |
237 |
+ import Data.Monoid |
238 |
+ |
239 |
+ import Data.Edison.Prelude |
240 |
+@@ -221,7 +222,7 @@ class (Functor s, MonadPlus s) => Sequence s where |
241 |
+ -- This function is always /unambiguous/. |
242 |
+ -- |
243 |
+ -- Default running time: @O( 1 )@ |
244 |
+- lview :: (Monad m) => s a -> m (a, s a) |
245 |
++ lview :: (Fail.MonadFail m) => s a -> m (a, s a) |
246 |
+ |
247 |
+ -- | Return the first element of a sequence. |
248 |
+ -- Signals an error if the sequence is empty. |
249 |
+@@ -249,7 +250,7 @@ class (Functor s, MonadPlus s) => Sequence s where |
250 |
+ -- This function is always /unambiguous/. |
251 |
+ -- |
252 |
+ -- Default running time: @O( 1 )@ |
253 |
+- lheadM :: (Monad m) => s a -> m a |
254 |
++ lheadM :: (Fail.MonadFail m) => s a -> m a |
255 |
+ |
256 |
+ -- | Delete the first element of the sequence. |
257 |
+ -- Signals error if sequence is empty. |
258 |
+@@ -277,7 +278,7 @@ class (Functor s, MonadPlus s) => Sequence s where |
259 |
+ -- This function is always /unambiguous/. |
260 |
+ -- |
261 |
+ -- Default running time: @O( 1 )@ |
262 |
+- ltailM :: (Monad m) => s a -> m (s a) |
263 |
++ ltailM :: (Fail.MonadFail m) => s a -> m (s a) |
264 |
+ |
265 |
+ -- | Separate a sequence into its last (rightmost) element and the |
266 |
+ -- remaining sequence. Calls 'fail' if the sequence is empty. |
267 |
+@@ -291,7 +292,7 @@ class (Functor s, MonadPlus s) => Sequence s where |
268 |
+ -- This function is always /unambiguous/. |
269 |
+ -- |
270 |
+ -- Default running time: @O( n )@ |
271 |
+- rview :: (Monad m) => s a -> m (a, s a) |
272 |
++ rview :: (Fail.MonadFail m) => s a -> m (a, s a) |
273 |
+ |
274 |
+ -- | Return the last (rightmost) element of the sequence. |
275 |
+ -- Signals error if sequence is empty. |
276 |
+@@ -319,7 +320,7 @@ class (Functor s, MonadPlus s) => Sequence s where |
277 |
+ -- This function is always /unambiguous/. |
278 |
+ -- |
279 |
+ -- Default running time: @O( n )@ |
280 |
+- rheadM :: (Monad m) => s a -> m a |
281 |
++ rheadM :: (Fail.MonadFail m) => s a -> m a |
282 |
+ |
283 |
+ -- | Delete the last (rightmost) element of the sequence. |
284 |
+ -- Signals an error if the sequence is empty. |
285 |
+@@ -347,7 +348,7 @@ class (Functor s, MonadPlus s) => Sequence s where |
286 |
+ -- This function is always /unambiguous/. |
287 |
+ -- |
288 |
+ -- Default running time: @O( n )@ |
289 |
+- rtailM :: (Monad m) => s a -> m (s a) |
290 |
++ rtailM :: (Fail.MonadFail m) => s a -> m (s a) |
291 |
+ |
292 |
+ -- | Returns 'True' if the sequence is empty and 'False' otherwise. |
293 |
+ -- |
294 |
+@@ -948,7 +949,7 @@ class (Functor s, MonadPlus s) => Sequence s where |
295 |
+ -- This function is always /unambiguous/. |
296 |
+ -- |
297 |
+ -- Default running time: @O( i )@ |
298 |
+- lookupM :: (Monad m) => Int -> s a -> m a |
299 |
++ lookupM :: (Fail.MonadFail m) => Int -> s a -> m a |
300 |
+ |
301 |
+ -- | Return the element at the given index, or the |
302 |
+ -- default argument if the index is out of bounds. All indexes are |
303 |
+diff --git a/src/Data/Edison/Seq/ListSeq.hs b/src/Data/Edison/Seq/ListSeq.hs |
304 |
+index 1ad677f..890b66f 100644 |
305 |
+--- a/src/Data/Edison/Seq/ListSeq.hs |
306 |
++++ b/src/Data/Edison/Seq/ListSeq.hs |
307 |
+@@ -40,9 +40,9 @@ module Data.Edison.Seq.ListSeq ( |
308 |
+ import Prelude hiding (concat,reverse,map,concatMap,foldr,foldl,foldr1,foldl1, |
309 |
+ filter,takeWhile,dropWhile,lookup,take,drop,splitAt, |
310 |
+ zip,zip3,zipWith,zipWith3,unzip,unzip3,null) |
311 |
+-import qualified Control.Monad.Identity as ID |
312 |
++import qualified Control.Monad.Fail as Fail |
313 |
+ import qualified Prelude |
314 |
+-import Data.Edison.Prelude |
315 |
++import Data.Edison.Prelude ( runFail_ ) |
316 |
+ import qualified Data.List |
317 |
+ import Data.Monoid |
318 |
+ import qualified Data.Edison.Seq as S ( Sequence(..) ) |
319 |
+@@ -54,16 +54,16 @@ singleton :: a -> [a] |
320 |
+ lcons :: a -> [a] -> [a] |
321 |
+ rcons :: a -> [a] -> [a] |
322 |
+ append :: [a] -> [a] -> [a] |
323 |
+-lview :: (Monad rm) => [a] -> rm (a, [a]) |
324 |
++lview :: (Fail.MonadFail rm) => [a] -> rm (a, [a]) |
325 |
+ lhead :: [a] -> a |
326 |
+-lheadM :: (Monad rm) => [a] -> rm a |
327 |
++lheadM :: (Fail.MonadFail rm) => [a] -> rm a |
328 |
+ ltail :: [a] -> [a] |
329 |
+-ltailM :: (Monad rm) => [a] -> rm [a] |
330 |
+-rview :: (Monad rm) => [a] -> rm (a, [a]) |
331 |
++ltailM :: (Fail.MonadFail rm) => [a] -> rm [a] |
332 |
++rview :: (Fail.MonadFail rm) => [a] -> rm (a, [a]) |
333 |
+ rhead :: [a] -> a |
334 |
+-rheadM :: (Monad rm) => [a] -> rm a |
335 |
++rheadM :: (Fail.MonadFail rm) => [a] -> rm a |
336 |
+ rtail :: [a] -> [a] |
337 |
+-rtailM :: (Monad rm) => [a] -> rm [a] |
338 |
++rtailM :: (Fail.MonadFail rm) => [a] -> rm [a] |
339 |
+ null :: [a] -> Bool |
340 |
+ size :: [a] -> Int |
341 |
+ concat :: [[a]] -> [a] |
342 |
+@@ -92,7 +92,7 @@ reduce1' :: (a -> a -> a) -> [a] -> a |
343 |
+ copy :: Int -> a -> [a] |
344 |
+ inBounds :: Int -> [a] -> Bool |
345 |
+ lookup :: Int -> [a] -> a |
346 |
+-lookupM :: (Monad m) => Int -> [a] -> m a |
347 |
++lookupM :: (Fail.MonadFail m) => Int -> [a] -> m a |
348 |
+ lookupWithDefault :: a -> Int -> [a] -> a |
349 |
+ update :: Int -> a -> [a] -> [a] |
350 |
+ adjust :: (a -> a) -> Int -> [a] -> [a] |
351 |
+@@ -252,7 +252,7 @@ inBounds i xs |
352 |
+ | i >= 0 = not (null (drop i xs)) |
353 |
+ | otherwise = False |
354 |
+ |
355 |
+-lookup i xs = ID.runIdentity (lookupM i xs) |
356 |
++lookup i xs = runFail_ (lookupM i xs) |
357 |
+ |
358 |
+ lookupM i xs |
359 |
+ | i < 0 = fail "ListSeq.lookup: not found" |