1 |
gienah 15/01/02 02:42:13 |
2 |
|
3 |
Added: syb-0.4.3-ghc-7.10.patch |
4 |
Log: |
5 |
Bump syb to 0.4.3, with tests patched for ghc 7.10. |
6 |
|
7 |
(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 618E971F) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-haskell/syb/files/syb-0.4.3-ghc-7.10.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/syb/files/syb-0.4.3-ghc-7.10.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/syb/files/syb-0.4.3-ghc-7.10.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: syb-0.4.3-ghc-7.10.patch |
16 |
=================================================================== |
17 |
--- syb-0.4.3-orig/tests/XML.hs 2014-12-31 19:40:41.000000000 +1100 |
18 |
+++ syb-0.4.3/tests/XML.hs 2015-01-02 12:47:10.082782760 +1100 |
19 |
@@ -13,6 +13,7 @@ |
20 |
|
21 |
import Test.HUnit |
22 |
|
23 |
+import Control.Applicative (Alternative(..), Applicative(..)) |
24 |
import Control.Monad |
25 |
import Data.Maybe |
26 |
import Data.Generics |
27 |
@@ -157,6 +158,17 @@ |
28 |
else Just (tail x, head x) |
29 |
) |
30 |
|
31 |
+instance Functor ReadX where |
32 |
+ fmap = liftM |
33 |
+ |
34 |
+instance Applicative ReadX where |
35 |
+ pure = return |
36 |
+ (<*>) = ap |
37 |
+ |
38 |
+instance Alternative ReadX where |
39 |
+ (<|>) = mplus |
40 |
+ empty = mzero |
41 |
+ |
42 |
-- ReadX is a monad! |
43 |
instance Monad ReadX where |
44 |
return x = ReadX (\y -> Just (y,x)) |
45 |
--- syb-0.4.3-orig/tests/Perm.hs 2014-12-31 19:40:41.000000000 +1100 |
46 |
+++ syb-0.4.3/tests/Perm.hs 2015-01-02 12:47:02.751422866 +1100 |
47 |
@@ -11,6 +11,7 @@ |
48 |
|
49 |
import Test.HUnit |
50 |
|
51 |
+import Control.Applicative (Alternative(..), Applicative(..)) |
52 |
import Control.Monad |
53 |
import Data.Generics |
54 |
|
55 |
@@ -44,6 +45,17 @@ |
56 |
else Just (tail x, head x) |
57 |
) |
58 |
|
59 |
+instance Functor ReadT where |
60 |
+ fmap = liftM |
61 |
+ |
62 |
+instance Applicative ReadT where |
63 |
+ pure = return |
64 |
+ (<*>) = ap |
65 |
+ |
66 |
+instance Alternative ReadT where |
67 |
+ (<|>) = mplus |
68 |
+ empty = mzero |
69 |
+ |
70 |
-- ReadT is a monad! |
71 |
instance Monad ReadT where |
72 |
return x = ReadT (\y -> Just (y,x)) |
73 |
--- syb-0.4.3-orig/tests/Bits.hs 2014-12-31 19:40:41.000000000 +1100 |
74 |
+++ syb-0.4.3/tests/Bits.hs 2015-01-02 12:46:37.842839944 +1100 |
75 |
@@ -39,6 +39,7 @@ |
76 |
import Data.Generics |
77 |
import Data.Char |
78 |
import Data.Maybe |
79 |
+import Control.Applicative (Alternative(..), Applicative(..)) |
80 |
import Control.Monad |
81 |
import CompanyDatatypes |
82 |
|
83 |
@@ -129,6 +130,16 @@ |
84 |
data ReadB a = ReadB (Bin -> (Maybe a, Bin)) |
85 |
unReadB (ReadB f) = f |
86 |
|
87 |
+instance Functor ReadB where |
88 |
+ fmap = liftM |
89 |
+ |
90 |
+instance Applicative ReadB where |
91 |
+ pure = return |
92 |
+ (<*>) = ap |
93 |
+ |
94 |
+instance Alternative ReadB where |
95 |
+ (<|>) = mplus |
96 |
+ empty = mzero |
97 |
|
98 |
-- It's a monad. |
99 |
instance Monad ReadB where |
100 |
--- syb-0.4.3-orig/tests/Encode.hs 2014-12-31 19:40:41.000000000 +1100 |
101 |
+++ syb-0.4.3/tests/Encode.hs 2015-01-02 12:51:48.500949407 +1100 |
102 |
@@ -6,6 +6,8 @@ |
103 |
|
104 |
module Encode () where |
105 |
|
106 |
+import Control.Applicative (Applicative(..)) |
107 |
+import Control.Monad (ap, liftM) |
108 |
import Data.Generics |
109 |
|
110 |
data Bit = Zero | One |
111 |
@@ -62,6 +64,11 @@ |
112 |
-- Sec. 3.3 cont'd |
113 |
|
114 |
data EncM a -- The encoder monad |
115 |
+instance Functor EncM where |
116 |
+ fmap = liftM |
117 |
+instance Applicative EncM where |
118 |
+ pure = return |
119 |
+ (<*>) = ap |
120 |
instance Monad EncM |
121 |
where |
122 |
return = undefined |
123 |
--- syb-0.4.3-orig/tests/GRead2.hs 2014-12-31 19:40:41.000000000 +1100 |
124 |
+++ syb-0.4.3/tests/GRead2.hs 2015-01-02 12:51:27.524567019 +1100 |
125 |
@@ -10,6 +10,8 @@ |
126 |
|
127 |
-} |
128 |
|
129 |
+import Control.Applicative (Applicative(..)) |
130 |
+import Control.Monad (ap, liftM) |
131 |
import Data.Generics |
132 |
|
133 |
gread :: Data a => String -> Maybe a |
134 |
@@ -18,6 +20,13 @@ |
135 |
-- The decoder monad |
136 |
newtype DecM a = D (String -> Maybe (String, a)) |
137 |
|
138 |
+instance Functor DecM where |
139 |
+ fmap = liftM |
140 |
+ |
141 |
+instance Applicative DecM where |
142 |
+ pure = return |
143 |
+ (<*>) = ap |
144 |
+ |
145 |
instance Monad DecM where |
146 |
return a = D (\s -> Just (s,a)) |
147 |
(D m) >>= k = D (\s -> |
148 |
--- syb-0.4.3-orig/tests/Ext1.hs 2014-12-31 19:40:41.000000000 +1100 |
149 |
+++ syb-0.4.3/tests/Ext1.hs 2015-01-02 10:30:39.396517984 +1100 |
150 |
@@ -1,4 +1,5 @@ |
151 |
{-# OPTIONS -fglasgow-exts #-} |
152 |
+{-# LANGUAGE CPP #-} |
153 |
|
154 |
module Ext1 (tests) where |
155 |
|
156 |
@@ -11,8 +12,11 @@ |
157 |
import Test.HUnit |
158 |
|
159 |
import Data.Generics |
160 |
+#if MIN_VERSION_base(4,8,0) |
161 |
+import GHC.Base hiding(foldr) |
162 |
+#else |
163 |
import GHC.Base |
164 |
- |
165 |
+#endif |
166 |
|
167 |
-- Unsafe coerce |
168 |
unsafeCoerce :: a -> b |