1 |
qnikst 14/02/24 07:03:35 |
2 |
|
3 |
Added: cgi-3001.1.8.5-ghc78.patch |
4 |
Log: |
5 |
add new version, drop old |
6 |
|
7 |
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0xEAD50D64D8D3571A!) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-haskell/cgi/files/cgi-3001.1.8.5-ghc78.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/cgi/files/cgi-3001.1.8.5-ghc78.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-haskell/cgi/files/cgi-3001.1.8.5-ghc78.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: cgi-3001.1.8.5-ghc78.patch |
16 |
=================================================================== |
17 |
diff --git a/Network/CGI/Protocol.hs b/Network/CGI/Protocol.hs |
18 |
index 6b9d2ec..e9a14ff 100644 |
19 |
--- a/Network/CGI/Protocol.hs |
20 |
+++ b/Network/CGI/Protocol.hs |
21 |
@@ -11,7 +11,7 @@ |
22 |
-- An implementation of the program side of the CGI protocol. |
23 |
-- |
24 |
----------------------------------------------------------------------------- |
25 |
- |
26 |
+{-# LANGUAGE CPP, DeriveDataTypeable #-} |
27 |
module Network.CGI.Protocol ( |
28 |
-- * CGI request |
29 |
CGIRequest(..), Input(..), |
30 |
@@ -44,7 +44,12 @@ import System.IO (Handle, hPutStrLn, stderr, hFlush, hSetBinaryMode) |
31 |
import qualified Data.ByteString.Lazy.Char8 as BS |
32 |
import Data.ByteString.Lazy.Char8 (ByteString) |
33 |
|
34 |
+#if MIN_VERSION_base(4,7,0) |
35 |
+import Data.Typeable |
36 |
+#else |
37 |
import Data.Typeable (Typeable(..), mkTyConApp, mkTyCon) |
38 |
+#endif |
39 |
+ |
40 |
|
41 |
import Network.CGI.Header |
42 |
import Network.CGI.Multipart |
43 |
@@ -72,8 +77,10 @@ data CGIRequest = |
44 |
} |
45 |
deriving (Show) |
46 |
|
47 |
+#if ! MIN_VERSION_base(4,7,0) |
48 |
instance Typeable CGIResult where |
49 |
typeOf _ = mkTyConApp (mkTyCon "Network.CGI.Protocol.CGIResult") [] |
50 |
+#endif |
51 |
|
52 |
-- | The value of an input parameter, and some metadata. |
53 |
data Input = Input { |
54 |
@@ -90,7 +97,11 @@ data Input = Input { |
55 |
-- | The result of a CGI program. |
56 |
data CGIResult = CGIOutput ByteString |
57 |
| CGINothing |
58 |
+#if MIN_VERSION_base(4,7,0) |
59 |
+ deriving (Show, Read, Eq, Ord, Typeable) |
60 |
+#else |
61 |
deriving (Show, Read, Eq, Ord) |
62 |
+#endif |
63 |
|
64 |
-- |
65 |
-- * Running CGI actions |
66 |
|
67 |
|
68 |
diff --git a/Network/CGI/Monad.hs b/Network/CGI/Monad.hs |
69 |
index 2294f8c..7ed116c 100644 |
70 |
--- a/Network/CGI/Monad.hs |
71 |
+++ b/Network/CGI/Monad.hs |
72 |
@@ -1,4 +1,5 @@ |
73 |
{-# OPTIONS_GHC -fglasgow-exts #-} |
74 |
+{-# LANGUAGE CPP, DeriveDataTypeable #-} |
75 |
----------------------------------------------------------------------------- |
76 |
-- | |
77 |
-- Module : Network.CGI.Monad |
78 |
@@ -40,8 +41,12 @@ import Control.Monad.Error (MonadError(..)) |
79 |
import Control.Monad.Reader (ReaderT(..), asks) |
80 |
import Control.Monad.Writer (WriterT(..), tell) |
81 |
import Control.Monad.Trans (MonadTrans, MonadIO, liftIO, lift) |
82 |
+#if MIN_VERSION_base(4,7,0) |
83 |
+import Data.Typeable |
84 |
+#else |
85 |
import Data.Typeable (Typeable(..), Typeable1(..), |
86 |
- mkTyConApp, mkTyCon) |
87 |
+ mkTyConApp, mkTyCon) |
88 |
+#endif |
89 |
|
90 |
import Network.CGI.Protocol |
91 |
|
92 |
@@ -55,10 +60,14 @@ type CGI a = CGIT IO a |
93 |
|
94 |
-- | The CGIT monad transformer. |
95 |
newtype CGIT m a = CGIT { unCGIT :: ReaderT CGIRequest (WriterT Headers m) a } |
96 |
+#if MIN_VERSION_base(4,7,0) |
97 |
+ deriving (Typeable) |
98 |
|
99 |
+#else |
100 |
instance (Typeable1 m, Typeable a) => Typeable (CGIT m a) where |
101 |
typeOf _ = mkTyConApp (mkTyCon "Network.CGI.Monad.CGIT") |
102 |
[typeOf1 (undefined :: m a), typeOf (undefined :: a)] |
103 |
+#endif |
104 |
|
105 |
instance (Functor m, Monad m) => Functor (CGIT m) where |
106 |
fmap f c = CGIT (fmap f (unCGIT c)) |