on iko/ghcjs-patch-master help sign in
add ghc patches :(
commite1355cac7db42ac6baa57ef06ba76c334a1e5a42 authorMoritz Angermann <moritz.angermann@gmail.com> dateFri 18 Jan 2019, 10:48 (8 years ago) parent6673652
72 files changed+8667
default.nix+5 patches/default.nix+9 patches/ghc841/array-0.5.2.0.patch+12 patches/ghc841/deepseq-1.4.3.0.patch+12 patches/ghc841/default.nix+14 patches/ghc841/hpc-0.6.0.3.patch+16 patches/ghc841/mtl-2.2.2.patch+256 patches/ghc841/parallel-3.2.1.1.patch+12 patches/ghc841/parsec-3.1.13.0.patch+23 patches/ghc841/random-1.1.patch+406 patches/ghc841/time-1.8.0.2.patch+146 patches/ghc841/unix-2.7.2.2.patch+109 patches/ghc841/vector-0.11.0.0.patch+508 patches/ghc841/xhtml-3000.2.2.patch+20 patches/ghc842/array-0.5.2.0.patch+12 patches/ghc842/deepseq-1.4.3.0.patch+12 patches/ghc842/default.nix+12 patches/ghc842/hpc-0.6.0.3.patch+16 patches/ghc842/parallel-3.2.1.1.patch+12 patches/ghc842/parsec-3.1.13.0.patch+23 patches/ghc842/random-1.1.patch+406 patches/ghc842/time-1.8.0.2.patch+146 patches/ghc842/unix-2.7.2.2.patch+109 patches/ghc842/vector-0.11.0.0.patch+508 patches/ghc843/array-0.5.2.0.patch+12 patches/ghc843/deepseq-1.4.3.0.patch+12 patches/ghc843/default.nix+12 patches/ghc843/hpc-0.6.0.3.patch+16 patches/ghc843/parallel-3.2.1.1.patch+12 patches/ghc843/parsec-3.1.13.0.patch+23 patches/ghc843/random-1.1.patch+406 patches/ghc843/time-1.8.0.2.patch+146 patches/ghc843/unix-2.7.2.2.patch+109 patches/ghc843/vector-0.11.0.0.patch+508 patches/ghc844/array-0.5.2.0.patch+12 patches/ghc844/deepseq-1.4.3.0.patch+12 patches/ghc844/default.nix+12 patches/ghc844/hpc-0.6.0.3.patch+16 patches/ghc844/parallel-3.2.1.1.patch+12 patches/ghc844/parsec-3.1.13.0.patch+23 patches/ghc844/random-1.1.patch+406 patches/ghc844/time-1.8.0.2.patch+146 patches/ghc844/unix-2.7.2.2.patch+109 patches/ghc844/vector-0.11.0.0.patch+508 patches/ghc861/array-0.5.2.0.patch+302 patches/ghc861/binary-0.8.6.0.patch+19 patches/ghc861/containers-0.6.0.1.patch+1 patches/ghc861/default.nix+12 patches/ghc861/hpc-0.6.0.3.patch+17 patches/ghc861/parsec-3.1.13.0.patch+35 patches/ghc861/process-1.6.3.0.patch+154 patches/ghc861/time-1.8.0.2.patch+146 patches/ghc861/transformers-0.5.5.0.patch+524 patches/ghc861/unix-2.7.2.2.patch+109 patches/ghc862/binary-0.8.6.0.patch+19 patches/ghc862/containers-0.6.0.1.patch+1 patches/ghc862/default.nix+11 patches/ghc862/hpc-0.6.0.3.patch+17 patches/ghc862/parsec-3.1.13.0.patch+35 patches/ghc862/process-1.6.3.0.patch+154 patches/ghc862/time-1.8.0.2.patch+146 patches/ghc862/transformers-0.5.5.0.patch+524 patches/ghc862/unix-2.7.2.2.patch+109 patches/ghc863/binary-0.8.6.0.patch+19 patches/ghc863/containers-0.6.0.1.patch+1 patches/ghc863/default.nix+11 patches/ghc863/hpc-0.6.0.3.patch+17 patches/ghc863/parsec-3.1.13.0.patch+35 patches/ghc863/process-1.6.3.0.patch+154 patches/ghc863/time-1.8.0.2.patch+146 patches/ghc863/transformers-0.5.5.0.patch+524 patches/ghc863/unix-2.7.2.2.patch+109
default.nix+5
@@ -13,6 +13,11 @@ let
1313 (pkg-def hackage);
1414in
1515hackage: let haskell = {
16+ # ghc hackage patches.
17+ # these are patches that turn hackage packages into the same as the ones
18+ # ghc ships with the supposedly same version. See GHC Track Issue: 16199
19+ ghcHackagePatches = import ./patches;
20+
1621 compat = import ./compat hackage;
1722 mkPkgSet = pkgs: pkg-def: import ./package-set.nix { inherit pkgs hackage haskell; pkg-def = strip-pkg-def pkgs pkg-def; };
1823 # The *new* pkg set is one that build components.
patches/default.nixnew file+9
@@ -0,0 +1,9 @@
1+{
2+ ghc841 = import ./ghc841;
3+ ghc842 = import ./ghc842;
4+ ghc843 = import ./ghc843;
5+ ghc844 = import ./ghc844;
6+ ghc861 = import ./ghc861;
7+ ghc862 = import ./ghc862;
8+ ghc863 = import ./ghc863;
9+}
patches/ghc841/array-0.5.2.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-array-0.5.2.0/array.cabal ghc-package-array-0.5.2.0/array.cabal
2+--- hackage-package-array-0.5.2.0/array.cabal 2017-07-04 06:06:07.000000000 +0800
3++++ ghc-package-array-0.5.2.0/array.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -37,7 +37,7 @@
5+ Trustworthy,
6+ UnboxedTuples,
7+ UnliftedFFITypes
8+- build-depends: base >= 4.7 && < 4.11
9++ build-depends: base >= 4.7 && < 4.12
10+ ghc-options: -Wall
11+ exposed-modules:
12+ Data.Array
patches/ghc841/deepseq-1.4.3.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-deepseq-1.4.3.0/deepseq.cabal ghc-package-deepseq-1.4.3.0/deepseq.cabal
2+--- hackage-package-deepseq-1.4.3.0/deepseq.cabal 2017-07-20 06:00:58.000000000 +0800
3++++ ghc-package-deepseq-1.4.3.0/deepseq.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -61,7 +61,7 @@
5+ if impl(ghc>=7.8)
6+ other-extensions: EmptyCase
7+
8+- build-depends: base >= 4.5 && < 4.11,
9++ build-depends: base >= 4.5 && < 4.12,
10+ array >= 0.4 && < 0.6
11+ ghc-options: -Wall
12+
patches/ghc841/default.nixnew file+14
@@ -0,0 +1,14 @@
1+{
2+ packages.array.patches = [ ./array-0.5.2.0.patch ];
3+ packages.deepseq.patches = [ ./deepseq-1.4.3.0.patch ];
4+ packages.default.nix.patches = [ ./default.nix ];
5+ packages.hpc.patches = [ ./hpc-0.6.0.3.patch ];
6+ packages.mtl.patches = [ ./mtl-2.2.2.patch ];
7+ packages.parallel.patches = [ ./parallel-3.2.1.1.patch ];
8+ packages.parsec.patches = [ ./parsec-3.1.13.0.patch ];
9+ packages.random.patches = [ ./random-1.1.patch ];
10+ packages.time.patches = [ ./time-1.8.0.2.patch ];
11+ packages.unix.patches = [ ./unix-2.7.2.2.patch ];
12+ packages.vector.patches = [ ./vector-0.11.0.0.patch ];
13+ packages.xhtml.patches = [ ./xhtml-3000.2.2.patch ];
14+}
patches/ghc841/hpc-0.6.0.3.patchnew file+16
@@ -0,0 +1,16 @@
1+diff -ur hackage-package-hpc-0.6.0.3/hpc.cabal ghc-package-hpc-0.6.0.3/hpc.cabal
2+--- hackage-package-hpc-0.6.0.3/hpc.cabal 2016-05-04 18:47:19.000000000 +0800
3++++ ghc-package-hpc-0.6.0.3/hpc.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -35,9 +35,9 @@
5+ Trace.Hpc.Reflect
6+
7+ Build-Depends:
8+- base >= 4.4.1 && < 4.10,
9++ base >= 4.4.1 && < 4.12,
10+ containers >= 0.4.1 && < 0.6,
11+- directory >= 1.1 && < 1.3,
12++ directory >= 1.1 && < 1.4,
13+ filepath >= 1 && < 1.5,
14+- time >= 1.2 && < 1.7
15++ time >= 1.2 && < 1.9
16+ ghc-options: -Wall
patches/ghc841/mtl-2.2.2.patchnew file+256
@@ -0,0 +1,256 @@
1+diff -ur hackage-package-mtl-2.2.2/CHANGELOG.markdown ghc-package-mtl-2.2.2/CHANGELOG.markdown
2+--- hackage-package-mtl-2.2.2/CHANGELOG.markdown 2018-02-25 06:02:27.000000000 +0800
3++++ ghc-package-mtl-2.2.2/CHANGELOG.markdown 2001-09-09 09:46:40.000000000 +0800
4+@@ -3,10 +3,6 @@
5+ * `Control.Monad.Identity` now re-exports `Control.Monad.Trans.Identity`
6+ * Fix a bug in which `Control.Monad.State.Class.modify'` was not as strict in
7+ the new state as its counterparts in `transformers`
8+-* Add a `MonadError () Maybe` instance
9+-* Add `liftEither :: MonadError e m => Either e a -> m a` to
10+- `Control.Monad.Except{.Class}`
11+-* Add a `MonadWriter w ((,) w)` instance (when built against `base-4.9` or later)
12+
13+ 2.2.1
14+ -------
15+diff -ur hackage-package-mtl-2.2.2/Control/Monad/Cont/Class.hs ghc-package-mtl-2.2.2/Control/Monad/Cont/Class.hs
16+--- hackage-package-mtl-2.2.2/Control/Monad/Cont/Class.hs 2018-02-25 06:02:27.000000000 +0800
17++++ ghc-package-mtl-2.2.2/Control/Monad/Cont/Class.hs 2001-09-09 09:46:40.000000000 +0800
18+@@ -104,7 +104,6 @@
19+ instance (Error e, MonadCont m) => MonadCont (ErrorT e m) where
20+ callCC = Error.liftCallCC callCC
21+
22+-{- | @since 2.2 -}
23+ instance MonadCont m => MonadCont (ExceptT e m) where
24+ callCC = Except.liftCallCC callCC
25+
26+diff -ur hackage-package-mtl-2.2.2/Control/Monad/Error/Class.hs ghc-package-mtl-2.2.2/Control/Monad/Error/Class.hs
27+--- hackage-package-mtl-2.2.2/Control/Monad/Error/Class.hs 2018-02-25 06:02:27.000000000 +0800
28++++ ghc-package-mtl-2.2.2/Control/Monad/Error/Class.hs 2001-09-09 09:46:40.000000000 +0800
29+@@ -41,7 +41,6 @@
30+ module Control.Monad.Error.Class (
31+ Error(..),
32+ MonadError(..),
33+- liftEither,
34+ ) where
35+
36+ import Control.Monad.Trans.Except (Except, ExceptT)
37+@@ -68,7 +67,7 @@
38+ #endif
39+
40+ import Data.Monoid
41+-import Prelude (Either(..), Maybe(..), either, (.), IO)
42++import Prelude (Either(..), (.), IO)
43+
44+ {- |
45+ The strategy of combining computations that can throw exceptions
46+@@ -77,7 +76,7 @@
47+
48+ Is parameterized over the type of error information and
49+ the monad type constructor.
50+-It is common to use @'Either' String@ as the monad type constructor
51++It is common to use @'Data.Either' String@ as the monad type constructor
52+ for an error monad in which error descriptions take the form of strings.
53+ In that case and many other common cases the resulting monad is already defined
54+ as an instance of the 'MonadError' class.
55+@@ -106,28 +105,10 @@
56+ {-# MINIMAL throwError, catchError #-}
57+ #endif
58+
59+-{- |
60+-Lifts an @'Either' e@ into any @'MonadError' e@.
61+-
62+-> do { val <- liftEither =<< action1; action2 }
63+-
64+-where @action1@ returns an 'Either' to represent errors.
65+-
66+-@since 2.2.2
67+--}
68+-liftEither :: MonadError e m => Either e a -> m a
69+-liftEither = either throwError return
70+-
71+ instance MonadError IOException IO where
72+ throwError = ioError
73+ catchError = catch
74+
75+-{- | @since 2.2.2 -}
76+-instance MonadError () Maybe where
77+- throwError () = Nothing
78+- catchError Nothing f = f ()
79+- catchError x _ = x
80+-
81+ -- ---------------------------------------------------------------------------
82+ -- Our parameterizable error monad
83+
84+@@ -140,7 +121,6 @@
85+ throwError = ErrorT.throwError
86+ catchError = ErrorT.catchError
87+
88+-{- | @since 2.2 -}
89+ instance Monad m => MonadError e (ExceptT e m) where
90+ throwError = ExceptT.throwE
91+ catchError = ExceptT.catchE
92+diff -ur hackage-package-mtl-2.2.2/Control/Monad/Error.hs ghc-package-mtl-2.2.2/Control/Monad/Error.hs
93+--- hackage-package-mtl-2.2.2/Control/Monad/Error.hs 2018-02-25 06:02:27.000000000 +0800
94++++ ghc-package-mtl-2.2.2/Control/Monad/Error.hs 2001-09-09 09:46:40.000000000 +0800
95+@@ -22,7 +22,7 @@
96+ [Zero and plus:] Zero is represented by an empty error and the plus operation
97+ executes its second argument if the first fails.
98+
99+-[Example type:] @'Either' String a@
100++[Example type:] @'Data.Either' String a@
101+
102+ The Error monad (also called the Exception monad).
103+ -}
104+@@ -33,7 +33,7 @@
105+ Andy Gill (<http://web.cecs.pdx.edu/~andy/>)
106+ -}
107+ module Control.Monad.Error
108+- {-# DEPRECATED "Use \"Control.Monad.Except\" instead" #-} (
109++ {-# DEPRECATED "Use Control.Monad.Except instead" #-} (
110+ -- * Monads with error handling
111+ MonadError(..),
112+ Error(..),
113+diff -ur hackage-package-mtl-2.2.2/Control/Monad/Except.hs ghc-package-mtl-2.2.2/Control/Monad/Except.hs
114+--- hackage-package-mtl-2.2.2/Control/Monad/Except.hs 2018-02-25 06:02:27.000000000 +0800
115++++ ghc-package-mtl-2.2.2/Control/Monad/Except.hs 2001-09-09 09:46:40.000000000 +0800
116+@@ -19,11 +19,9 @@
117+ [Useful for:] Building computations from sequences of functions that may fail
118+ or using exception handling to structure error handling.
119+
120+-[Example type:] @'Either' String a@
121++[Example type:] @'Data.Either' String a@
122+
123+ The Error monad (also called the Exception monad).
124+-
125+-@since 2.2.1
126+ -}
127+
128+ {-
129+@@ -33,11 +31,8 @@
130+ -}
131+ module Control.Monad.Except
132+ (
133+- -- * Warning
134+- -- $warning
135+ -- * Monads with error handling
136+ MonadError(..),
137+- liftEither,
138+ -- * The ExceptT monad transformer
139+ ExceptT(ExceptT),
140+ Except,
141+@@ -75,18 +70,6 @@
142+ import Control.Monad.Instances ()
143+ #endif
144+
145+-{- $warning
146+-Please do not confuse 'ExceptT' and 'throwError' with 'Control.Exception.Exception' /
147+-'Control.Exception.SomeException' and 'Control.Exception.catch', respectively. The latter
148+-are for exceptions built into GHC, by default, and are mostly used from within the IO monad.
149+-They do not interact with the \"exceptions\" in this package at all. This package allows you
150+-to define a new kind of exception control mechanism which does not necessarily need your code to
151+-be placed in the IO monad.
152+-
153+-In short, all \"catching\" mechanisms in this library will be unable to catch exceptions thrown
154+-by functions in the "Control.Exception" module, and vice-versa.
155+--}
156+-
157+ {- $customErrorExample
158+ Here is an example that demonstrates the use of a custom error data type with
159+ the 'throwError' and 'catchError' exception mechanism from 'MonadError'.
160+diff -ur hackage-package-mtl-2.2.2/Control/Monad/RWS/Class.hs ghc-package-mtl-2.2.2/Control/Monad/RWS/Class.hs
161+--- hackage-package-mtl-2.2.2/Control/Monad/RWS/Class.hs 2018-02-25 06:02:27.000000000 +0800
162++++ ghc-package-mtl-2.2.2/Control/Monad/RWS/Class.hs 2001-09-09 09:46:40.000000000 +0800
163+@@ -57,7 +57,6 @@
164+ -- All of these instances need UndecidableInstances,
165+ -- because they do not satisfy the coverage condition.
166+
167+--- | @since 2.2
168+ instance MonadRWS r w s m => MonadRWS r w s (ExceptT e m)
169+ instance (Error e, MonadRWS r w s m) => MonadRWS r w s (ErrorT e m)
170+ instance MonadRWS r w s m => MonadRWS r w s (IdentityT m)
171+diff -ur hackage-package-mtl-2.2.2/Control/Monad/Reader/Class.hs ghc-package-mtl-2.2.2/Control/Monad/Reader/Class.hs
172+--- hackage-package-mtl-2.2.2/Control/Monad/Reader/Class.hs 2018-02-25 06:02:27.000000000 +0800
173++++ ghc-package-mtl-2.2.2/Control/Monad/Reader/Class.hs 2001-09-09 09:46:40.000000000 +0800
174+@@ -137,7 +137,6 @@
175+ local = mapErrorT . local
176+ reader = lift . reader
177+
178+-{- | @since 2.2 -}
179+ instance MonadReader r m => MonadReader r (ExceptT e m) where
180+ ask = lift ask
181+ local = mapExceptT . local
182+diff -ur hackage-package-mtl-2.2.2/Control/Monad/State/Class.hs ghc-package-mtl-2.2.2/Control/Monad/State/Class.hs
183+--- hackage-package-mtl-2.2.2/Control/Monad/State/Class.hs 2018-02-25 06:02:27.000000000 +0800
184++++ ghc-package-mtl-2.2.2/Control/Monad/State/Class.hs 2001-09-09 09:46:40.000000000 +0800
185+@@ -89,8 +89,6 @@
186+
187+ -- | A variant of 'modify' in which the computation is strict in the
188+ -- new state.
189+---
190+--- @since 2.2
191+ modify' :: MonadState s m => (s -> s) -> m ()
192+ modify' f = do
193+ s' <- get
194+@@ -139,7 +137,6 @@
195+ put = lift . put
196+ state = lift . state
197+
198+--- | @since 2.2
199+ instance MonadState s m => MonadState s (ExceptT e m) where
200+ get = lift get
201+ put = lift . put
202+diff -ur hackage-package-mtl-2.2.2/Control/Monad/Writer/Class.hs ghc-package-mtl-2.2.2/Control/Monad/Writer/Class.hs
203+--- hackage-package-mtl-2.2.2/Control/Monad/Writer/Class.hs 2018-02-25 06:02:27.000000000 +0800
204++++ ghc-package-mtl-2.2.2/Control/Monad/Writer/Class.hs 2001-09-09 09:46:40.000000000 +0800
205+@@ -103,17 +103,6 @@
206+ a <- m
207+ return (a, f)
208+
209+-#if MIN_VERSION_base(4,9,0)
210+--- | __NOTE__: This instance is only defined for @base >= 4.9.0@.
211+---
212+--- @since 2.2.2
213+-instance (Monoid w) => MonadWriter w ((,) w) where
214+- writer ~(a, w) = (w, a)
215+- tell w = (w, ())
216+- listen ~(w, a) = (w, (a, w))
217+- pass ~(w, (a, f)) = (f w, a)
218+-#endif
219+-
220+ instance (Monoid w, Monad m) => MonadWriter w (Lazy.WriterT w m) where
221+ writer = Lazy.writer
222+ tell = Lazy.tell
223+@@ -150,7 +139,6 @@
224+ listen = Error.liftListen listen
225+ pass = Error.liftPass pass
226+
227+--- | @since 2.2
228+ instance MonadWriter w m => MonadWriter w (ExceptT e m) where
229+ writer = lift . writer
230+ tell = lift . tell
231+diff -ur hackage-package-mtl-2.2.2/mtl.cabal ghc-package-mtl-2.2.2/mtl.cabal
232+--- hackage-package-mtl-2.2.2/mtl.cabal 2018-02-25 06:02:27.000000000 +0800
233++++ ghc-package-mtl-2.2.2/mtl.cabal 2001-09-09 09:46:40.000000000 +0800
234+@@ -25,8 +25,8 @@
235+ GHC==7.8.4,
236+ GHC==7.10.3,
237+ GHC==8.0.2,
238+- GHC==8.2.2,
239+- GHC==8.4.1
240++ GHC==8.2.1,
241++ GHC==8.3.*
242+
243+ source-repository head
244+ type: git
245+@@ -66,11 +66,6 @@
246+ FlexibleInstances
247+ UndecidableInstances
248+
249+- -- This is a SafeHaskell safeguard (pun intended) to explicitly declare the API contract of `mtl`
250+- -- GHC versions before 7.4 were hopelessly broken or incapable of SafeHaskell
251+- if impl(ghc >= 7.4)
252+- default-extensions: Safe
253+-
254+ ghc-options: -Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations
255+
256+ if impl(ghc >= 8.0)
patches/ghc841/parallel-3.2.1.1.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-parallel-3.2.1.1/parallel.cabal ghc-package-parallel-3.2.1.1/parallel.cabal
2+--- hackage-package-parallel-3.2.1.1/parallel.cabal 2017-04-09 00:25:01.000000000 +0800
3++++ ghc-package-parallel-3.2.1.1/parallel.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -34,7 +34,7 @@
5+
6+ build-depends:
7+ array >= 0.3 && < 0.6,
8+- base >= 4.3 && < 4.11,
9++ base >= 4.3 && < 4.12,
10+ containers >= 0.4 && < 0.6,
11+ deepseq >= 1.1 && < 1.5
12+
patches/ghc841/parsec-3.1.13.0.patchnew file+23
@@ -0,0 +1,23 @@
1+diff -ur hackage-package-parsec-3.1.13.0/parsec.cabal ghc-package-parsec-3.1.13.0/parsec.cabal
2+--- hackage-package-parsec-3.1.13.0/parsec.cabal 2018-02-06 17:13:02.000000000 +0800
3++++ ghc-package-parsec-3.1.13.0/parsec.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -21,8 +21,8 @@
5+ license-file: LICENSE
6+ author: Daan Leijen <daan@microsoft.com>, Paolo Martini <paolo@nemail.it>, Antoine Latter <aslatter@gmail.com>
7+ maintainer: Herbert Valerio Riedel <hvr@gnu.org>
8+-homepage: https://github.com/hvr/parsec
9+-bug-reports: https://github.com/hvr/parsec/issues
10++homepage: https://github.com/haskell/parsec
11++bug-reports: https://github.com/haskell/parsec/issues
12+ category: Parsing
13+
14+ build-type: Simple
15+@@ -32,7 +32,7 @@
16+
17+ source-repository head
18+ type: git
19+- location: https://github.com/hvr/parsec
20++ location: https://github.com/haskell/parsec
21+
22+ library
23+ hs-source-dirs: src
patches/ghc841/random-1.1.patchnew file+406
@@ -0,0 +1,406 @@
1+diff -ur hackage-package-random-1.1/README.md ghc-package-random-1.1/README.md
2+--- hackage-package-random-1.1/README.md 2014-09-17 05:34:43.000000000 +0800
3++++ ghc-package-random-1.1/README.md 2001-09-09 09:46:40.000000000 +0800
4+@@ -10,7 +10,7 @@
5+
6+ A module supplying this interface is required for Haskell 98 (but not Haskell
7+ 2010). An older [version]
8+-(http://www.haskell.org/ghc/docs/latest/html/libraries/haskell98/Random.html)
9++(https://downloads.haskell.org/~ghc/latest/docs/html/libraries/haskell98-2.0.0.3/Random.html)
10+ of this library is included with GHC in the haskell98 package. This newer
11+ version, with compatible api, is included in the [Haskell Platform]
12+ (http://www.haskell.org/platform/contents.html).
13+diff -ur hackage-package-random-1.1/System/Random.hs ghc-package-random-1.1/System/Random.hs
14+--- hackage-package-random-1.1/System/Random.hs 2014-09-17 05:34:43.000000000 +0800
15++++ ghc-package-random-1.1/System/Random.hs 2001-09-09 09:46:40.000000000 +0800
16+@@ -7,7 +7,7 @@
17+ -- Module : System.Random
18+ -- Copyright : (c) The University of Glasgow 2001
19+ -- License : BSD-style (see the file LICENSE in the 'random' repository)
20+---
21++--
22+ -- Maintainer : libraries@haskell.org
23+ -- Stability : stable
24+ -- Portability : portable
25+@@ -18,7 +18,7 @@
26+ -- or to get different results on each run by using the system-initialised
27+ -- generator or by supplying a seed from some other source.
28+ --
29+--- The library is split into two layers:
30++-- The library is split into two layers:
31+ --
32+ -- * A core /random number generator/ provides a supply of bits.
33+ -- The class 'RandomGen' provides a common interface to such generators.
34+@@ -40,40 +40,40 @@
35+ #include "MachDeps.h"
36+
37+ module System.Random
38+- (
39++ (
40+
41+- -- $intro
42++ -- $intro
43+
44+- -- * Random number generators
45++ -- * Random number generators
46+
47+ #ifdef ENABLE_SPLITTABLEGEN
48+- RandomGen(next, genRange)
49+- , SplittableGen(split)
50++ RandomGen(next, genRange)
51++ , SplittableGen(split)
52+ #else
53+- RandomGen(next, genRange, split)
54++ RandomGen(next, genRange, split)
55+ #endif
56+- -- ** Standard random number generators
57+- , StdGen
58+- , mkStdGen
59++ -- ** Standard random number generators
60++ , StdGen
61++ , mkStdGen
62+
63+- -- ** The global random number generator
64++ -- ** The global random number generator
65+
66+- -- $globalrng
67++ -- $globalrng
68+
69+- , getStdRandom
70+- , getStdGen
71+- , setStdGen
72+- , newStdGen
73++ , getStdRandom
74++ , getStdGen
75++ , setStdGen
76++ , newStdGen
77+
78+- -- * Random values of various types
79+- , Random ( random, randomR,
80+- randoms, randomRs,
81+- randomIO, randomRIO )
82++ -- * Random values of various types
83++ , Random ( random, randomR,
84++ randoms, randomRs,
85++ randomIO, randomRIO )
86+
87+- -- * References
88+- -- $references
89++ -- * References
90++ -- $references
91+
92+- ) where
93++ ) where
94+
95+ import Prelude
96+
97+@@ -83,15 +83,15 @@
98+ import Foreign.C.Types
99+
100+ #ifdef __NHC__
101+-import CPUTime ( getCPUTime )
102++import CPUTime ( getCPUTime )
103+ import Foreign.Ptr ( Ptr, nullPtr )
104+-import Foreign.C ( CTime, CUInt )
105++import Foreign.C ( CTime, CUInt )
106+ #else
107+-import System.CPUTime ( getCPUTime )
108+-import Data.Time ( getCurrentTime, UTCTime(..) )
109++import System.CPUTime ( getCPUTime )
110++import Data.Time ( getCurrentTime, UTCTime(..) )
111+ import Data.Ratio ( numerator, denominator )
112+ #endif
113+-import Data.Char ( isSpace, chr, ord )
114++import Data.Char ( isSpace, chr, ord )
115+ import System.IO.Unsafe ( unsafePerformIO )
116+ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
117+ #if MIN_VERSION_base (4,6,0)
118+@@ -99,7 +99,7 @@
119+ #else
120+ import Data.IORef ( atomicModifyIORef )
121+ #endif
122+-import Numeric ( readDec )
123++import Numeric ( readDec )
124+
125+ #ifdef __GLASGOW_HASKELL__
126+ import GHC.Exts ( build )
127+@@ -201,17 +201,17 @@
128+
129+ In addition, 'reads' may be used to map an arbitrary string (not necessarily one
130+ produced by 'show') onto a value of type 'StdGen'. In general, the 'Read'
131+-instance of 'StdGen' has the following properties:
132++instance of 'StdGen' has the following properties:
133+
134+-* It guarantees to succeed on any string.
135++* It guarantees to succeed on any string.
136+
137+-* It guarantees to consume only a finite portion of the string.
138++* It guarantees to consume only a finite portion of the string.
139+
140+ * Different argument strings are likely to result in different results.
141+
142+ -}
143+
144+-data StdGen
145++data StdGen
146+ = StdGen !Int32 !Int32
147+
148+ instance RandomGen StdGen where
149+@@ -224,8 +224,8 @@
150+ split = stdSplit
151+
152+ instance Show StdGen where
153+- showsPrec p (StdGen s1 s2) =
154+- showsPrec p s1 .
155++ showsPrec p (StdGen s1 s2) =
156++ showsPrec p s1 .
157+ showChar ' ' .
158+ showsPrec p s2
159+
160+@@ -234,11 +234,11 @@
161+ case try_read r of
162+ r'@[_] -> r'
163+ _ -> [stdFromString r] -- because it shouldn't ever fail.
164+- where
165++ where
166+ try_read r = do
167+ (s1, r1) <- readDec (dropWhile isSpace r)
168+- (s2, r2) <- readDec (dropWhile isSpace r1)
169+- return (StdGen s1 s2, r2)
170++ (s2, r2) <- readDec (dropWhile isSpace r1)
171++ return (StdGen s1 s2, r2)
172+
173+ {-
174+ If we cannot unravel the StdGen from a string, create
175+@@ -246,7 +246,7 @@
176+ -}
177+ stdFromString :: String -> (StdGen, String)
178+ stdFromString s = (mkStdGen num, rest)
179+- where (cs, rest) = splitAt 6 s
180++ where (cs, rest) = splitAt 6 s
181+ num = foldl (\a x -> x + 3 * a) 1 (map ord cs)
182+
183+
184+@@ -266,11 +266,11 @@
185+ mkStdGen32 :: Int32 -> StdGen
186+ mkStdGen32 sMaybeNegative = StdGen (s1+1) (s2+1)
187+ where
188+- -- We want a non-negative number, but we can't just take the abs
189+- -- of sMaybeNegative as -minBound == minBound.
190+- s = sMaybeNegative .&. maxBound
191+- (q, s1) = s `divMod` 2147483562
192+- s2 = q `mod` 2147483398
193++ -- We want a non-negative number, but we can't just take the abs
194++ -- of sMaybeNegative as -minBound == minBound.
195++ s = sMaybeNegative .&. maxBound
196++ (q, s1) = s `divMod` 2147483562
197++ s2 = q `mod` 2147483398
198+
199+ createStdGen :: Integer -> StdGen
200+ createStdGen s = mkStdGen32 $ fromIntegral s
201+@@ -323,7 +323,7 @@
202+ -- | A variant of 'random' that uses the global random number generator
203+ -- (see "System.Random#globalrng").
204+ randomIO :: IO a
205+- randomIO = getStdRandom random
206++ randomIO = getStdRandom random
207+
208+ -- | Produce an infinite list-equivalent of random values.
209+ {-# INLINE buildRandoms #-}
210+@@ -340,7 +340,7 @@
211+
212+ instance Random Integer where
213+ randomR ival g = randomIvalInteger ival g
214+- random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
215++ random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
216+
217+ instance Random Int where randomR = randomIvalIntegral; random = randomBounded
218+ instance Random Int8 where randomR = randomIvalIntegral; random = randomBounded
219+@@ -378,13 +378,13 @@
220+ instance Random CUIntMax where randomR = randomIvalIntegral; random = randomBounded
221+
222+ instance Random Char where
223+- randomR (a,b) g =
224++ randomR (a,b) g =
225+ case (randomIvalInteger (toInteger (ord a), toInteger (ord b)) g) of
226+ (x,g') -> (chr x, g')
227+- random g = randomR (minBound,maxBound) g
228++ random g = randomR (minBound,maxBound) g
229+
230+ instance Random Bool where
231+- randomR (a,b) g =
232++ randomR (a,b) g =
233+ case (randomIvalInteger (bool2Int a, bool2Int b) g) of
234+ (x, g') -> (int2Bool x, g')
235+ where
236+@@ -392,42 +392,42 @@
237+ bool2Int False = 0
238+ bool2Int True = 1
239+
240+- int2Bool :: Int -> Bool
241+- int2Bool 0 = False
242+- int2Bool _ = True
243++ int2Bool :: Int -> Bool
244++ int2Bool 0 = False
245++ int2Bool _ = True
246+
247+- random g = randomR (minBound,maxBound) g
248++ random g = randomR (minBound,maxBound) g
249+
250+ {-# INLINE randomRFloating #-}
251+ randomRFloating :: (Fractional a, Num a, Ord a, Random a, RandomGen g) => (a, a) -> g -> (a, g)
252+-randomRFloating (l,h) g
253++randomRFloating (l,h) g
254+ | l>h = randomRFloating (h,l) g
255+- | otherwise = let (coef,g') = random g in
256+- (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
257++ | otherwise = let (coef,g') = random g in
258++ (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
259+
260+ instance Random Double where
261+ randomR = randomRFloating
262+- random rng =
263+- case random rng of
264+- (x,rng') ->
265++ random rng =
266++ case random rng of
267++ (x,rng') ->
268+ -- We use 53 bits of randomness corresponding to the 53 bit significand:
269+- ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
270+- / fromIntegral twoto53, rng')
271+- where
272++ ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
273++ / fromIntegral twoto53, rng')
274++ where
275+ twoto53 = (2::Int64) ^ (53::Int64)
276+ mask53 = twoto53 - 1
277+-
278++
279+ instance Random Float where
280+ randomR = randomRFloating
281+- random rng =
282+- -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
283+- case random rng of
284+- (x,rng') ->
285++ random rng =
286++ -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
287++ case random rng of
288++ (x,rng') ->
289+ -- We use 24 bits of randomness corresponding to the 24 bit significand:
290+- ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
291+- / fromIntegral twoto24, rng')
292+- -- Note, encodeFloat is another option, but I'm not seeing slightly
293+- -- worse performance with the following [2011.06.25]:
294++ ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
295++ / fromIntegral twoto24, rng')
296++ -- Note, encodeFloat is another option, but I'm not seeing slightly
297++ -- worse performance with the following [2011.06.25]:
298+ -- (encodeFloat rand (-24), rng')
299+ where
300+ mask24 = twoto24 - 1
301+@@ -436,8 +436,8 @@
302+ -- CFloat/CDouble are basically the same as a Float/Double:
303+ instance Random CFloat where
304+ randomR = randomRFloating
305+- random rng = case random rng of
306+- (x,rng') -> (realToFrac (x::Float), rng')
307++ random rng = case random rng of
308++ (x,rng') -> (realToFrac (x::Float), rng')
309+
310+ instance Random CDouble where
311+ randomR = randomRFloating
312+@@ -445,8 +445,8 @@
313+ -- Presently, this is showing better performance than the Double instance:
314+ -- (And yet, if the Double instance uses randomFrac then its performance is much worse!)
315+ random = randomFrac
316+- -- random rng = case random rng of
317+- -- (x,rng') -> (realToFrac (x::Double), rng')
318++ -- random rng = case random rng of
319++ -- (x,rng') -> (realToFrac (x::Double), rng')
320+
321+ mkStdRNG :: Integer -> IO StdGen
322+ mkStdRNG o = do
323+@@ -463,7 +463,7 @@
324+
325+ {-# SPECIALIZE randomIvalInteger :: (Num a) =>
326+ (Integer, Integer) -> StdGen -> (a, StdGen) #-}
327+-
328++
329+ randomIvalInteger :: (RandomGen g, Num a) => (Integer, Integer) -> g -> (a, g)
330+ randomIvalInteger (l,h) rng
331+ | l > h = randomIvalInteger (h,l) rng
332+@@ -482,7 +482,7 @@
333+ k = h - l + 1
334+ magtgt = k * q
335+
336+- -- generate random values until we exceed the target magnitude
337++ -- generate random values until we exceed the target magnitude
338+ f mag v g | mag >= magtgt = (v, g)
339+ | otherwise = v' `seq`f (mag*b) v' g' where
340+ (x,g') = next g
341+@@ -494,18 +494,18 @@
342+ randomFrac = randomIvalDouble (0::Double,1) realToFrac
343+
344+ randomIvalDouble :: (RandomGen g, Fractional a) => (Double, Double) -> (Double -> a) -> g -> (a, g)
345+-randomIvalDouble (l,h) fromDouble rng
346++randomIvalDouble (l,h) fromDouble rng
347+ | l > h = randomIvalDouble (h,l) fromDouble rng
348+- | otherwise =
349++ | otherwise =
350+ case (randomIvalInteger (toInteger (minBound::Int32), toInteger (maxBound::Int32)) rng) of
351+- (x, rng') ->
352+- let
353+- scaled_x =
354+- fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
355++ (x, rng') ->
356++ let
357++ scaled_x =
358++ fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
359+ fromDouble ((0.5*h - 0.5*l) / (0.5 * realToFrac int32Count)) * -- avoid overflow
360+- fromIntegral (x::Int32)
361+- in
362+- (scaled_x, rng')
363++ fromIntegral (x::Int32)
364++ in
365++ (scaled_x, rng')
366+
367+ int32Count :: Integer
368+ int32Count = toInteger (maxBound::Int32) - toInteger (minBound::Int32) + 1 -- GHC ticket #3982
369+@@ -516,16 +516,16 @@
370+ stdNext :: StdGen -> (Int, StdGen)
371+ -- Returns values in the range stdRange
372+ stdNext (StdGen s1 s2) = (fromIntegral z', StdGen s1'' s2'')
373+- where z' = if z < 1 then z + 2147483562 else z
374+- z = s1'' - s2''
375++ where z' = if z < 1 then z + 2147483562 else z
376++ z = s1'' - s2''
377+
378+- k = s1 `quot` 53668
379+- s1' = 40014 * (s1 - k * 53668) - k * 12211
380+- s1'' = if s1' < 0 then s1' + 2147483563 else s1'
381+-
382+- k' = s2 `quot` 52774
383+- s2' = 40692 * (s2 - k' * 52774) - k' * 3791
384+- s2'' = if s2' < 0 then s2' + 2147483399 else s2'
385++ k = s1 `quot` 53668
386++ s1' = 40014 * (s1 - k * 53668) - k * 12211
387++ s1'' = if s1' < 0 then s1' + 2147483563 else s1'
388++
389++ k' = s2 `quot` 52774
390++ s2' = 40692 * (s2 - k' * 52774) - k' * 3791
391++ s2'' = if s2' < 0 then s2' + 2147483399 else s2'
392+
393+ stdSplit :: StdGen -> (StdGen, StdGen)
394+ stdSplit std@(StdGen s1 s2)
395+diff -ur hackage-package-random-1.1/random.cabal ghc-package-random-1.1/random.cabal
396+--- hackage-package-random-1.1/random.cabal 2014-09-17 05:34:43.000000000 +0800
397++++ ghc-package-random-1.1/random.cabal 2001-09-09 09:46:40.000000000 +0800
398+@@ -40,7 +40,7 @@
399+
400+ source-repository head
401+ type: git
402+- location: http://git.haskell.org/packages/random.git
403++ location: https://github.com/haskell/random.git
404+
405+ -- To run the Test-Suite:
406+ -- $ cabal configure --enable-tests
patches/ghc841/time-1.8.0.2.patchnew file+146
@@ -0,0 +1,146 @@
1+diff -ur hackage-package-time-1.8.0.2/configure ghc-package-time-1.8.0.2/configure
2+--- hackage-package-time-1.8.0.2/configure 2016-12-07 03:31:54.000000000 +0800
3++++ ghc-package-time-1.8.0.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,6 +1,6 @@
5+ #! /bin/sh
6+ # Guess values for system-dependent variables and create Makefiles.
7+-# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.
8++# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.0.2.
9+ #
10+ # Report bugs to <ashley@semantic.org>.
11+ #
12+@@ -580,8 +580,8 @@
13+ # Identity of this package.
14+ PACKAGE_NAME='Haskell time package'
15+ PACKAGE_TARNAME='time'
16+-PACKAGE_VERSION='1.8'
17+-PACKAGE_STRING='Haskell time package 1.8'
18++PACKAGE_VERSION='1.8.0.2'
19++PACKAGE_STRING='Haskell time package 1.8.0.2'
20+ PACKAGE_BUGREPORT='ashley@semantic.org'
21+ PACKAGE_URL=''
22+
23+@@ -653,7 +653,6 @@
24+ docdir
25+ oldincludedir
26+ includedir
27+-runstatedir
28+ localstatedir
29+ sharedstatedir
30+ sysconfdir
31+@@ -726,7 +725,6 @@
32+ sysconfdir='${prefix}/etc'
33+ sharedstatedir='${prefix}/com'
34+ localstatedir='${prefix}/var'
35+-runstatedir='${localstatedir}/run'
36+ includedir='${prefix}/include'
37+ oldincludedir='/usr/include'
38+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
39+@@ -979,15 +977,6 @@
40+ | -silent | --silent | --silen | --sile | --sil)
41+ silent=yes ;;
42+
43+- -runstatedir | --runstatedir | --runstatedi | --runstated \
44+- | --runstate | --runstat | --runsta | --runst | --runs \
45+- | --run | --ru | --r)
46+- ac_prev=runstatedir ;;
47+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
48+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
49+- | --run=* | --ru=* | --r=*)
50+- runstatedir=$ac_optarg ;;
51+-
52+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
53+ ac_prev=sbindir ;;
54+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
55+@@ -1125,7 +1114,7 @@
56+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
57+ datadir sysconfdir sharedstatedir localstatedir includedir \
58+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
59+- libdir localedir mandir runstatedir
60++ libdir localedir mandir
61+ do
62+ eval ac_val=\$$ac_var
63+ # Remove trailing slashes.
64+@@ -1238,7 +1227,7 @@
65+ # Omit some internal or obsolete options to make the list less imposing.
66+ # This message is too long to be a string in the A/UX 3.1 sh.
67+ cat <<_ACEOF
68+-\`configure' configures Haskell time package 1.8 to adapt to many kinds of systems.
69++\`configure' configures Haskell time package 1.8.0.2 to adapt to many kinds of systems.
70+
71+ Usage: $0 [OPTION]... [VAR=VALUE]...
72+
73+@@ -1278,7 +1267,6 @@
74+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
75+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
76+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
77+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
78+ --libdir=DIR object code libraries [EPREFIX/lib]
79+ --includedir=DIR C header files [PREFIX/include]
80+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
81+@@ -1300,7 +1288,7 @@
82+
83+ if test -n "$ac_init_help"; then
84+ case $ac_init_help in
85+- short | recursive ) echo "Configuration of Haskell time package 1.8:";;
86++ short | recursive ) echo "Configuration of Haskell time package 1.8.0.2:";;
87+ esac
88+ cat <<\_ACEOF
89+
90+@@ -1386,7 +1374,7 @@
91+ test -n "$ac_init_help" && exit $ac_status
92+ if $ac_init_version; then
93+ cat <<\_ACEOF
94+-Haskell time package configure 1.8
95++Haskell time package configure 1.8.0.2
96+ generated by GNU Autoconf 2.69
97+
98+ Copyright (C) 2012 Free Software Foundation, Inc.
99+@@ -1858,7 +1846,7 @@
100+ This file contains any messages produced by compilers while
101+ running configure, to aid debugging if configure makes a mistake.
102+
103+-It was created by Haskell time package $as_me 1.8, which was
104++It was created by Haskell time package $as_me 1.8.0.2, which was
105+ generated by GNU Autoconf 2.69. Invocation command line was
106+
107+ $ $0 $@
108+@@ -4193,7 +4181,7 @@
109+ # report actual input values of CONFIG_FILES etc. instead of their
110+ # values after options handling.
111+ ac_log="
112+-This file was extended by Haskell time package $as_me 1.8, which was
113++This file was extended by Haskell time package $as_me 1.8.0.2, which was
114+ generated by GNU Autoconf 2.69. Invocation command line was
115+
116+ CONFIG_FILES = $CONFIG_FILES
117+@@ -4246,7 +4234,7 @@
118+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
119+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
120+ ac_cs_version="\\
121+-Haskell time package config.status 1.8
122++Haskell time package config.status 1.8.0.2
123+ configured by $0, generated by GNU Autoconf 2.69,
124+ with options \\"\$ac_cs_config\\"
125+
126+diff -ur hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h
127+--- hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2017-05-13 18:29:46.000000000 +0800
128++++ ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2001-09-09 09:46:40.000000000 +0800
129+@@ -69,7 +69,7 @@
130+ #define PACKAGE_NAME "Haskell time package"
131+
132+ /* Define to the full name and version of this package. */
133+-#define PACKAGE_STRING "Haskell time package 1.8"
134++#define PACKAGE_STRING "Haskell time package 1.8.0.2"
135+
136+ /* Define to the one symbol short name of this package. */
137+ #define PACKAGE_TARNAME "time"
138+@@ -78,7 +78,7 @@
139+ #define PACKAGE_URL ""
140+
141+ /* Define to the version of this package. */
142+-#define PACKAGE_VERSION "1.8"
143++#define PACKAGE_VERSION "1.8.0.2"
144+
145+ /* Define to 1 if you have the ANSI C header files. */
146+ #define STDC_HEADERS 1
patches/ghc841/unix-2.7.2.2.patchnew file+109
@@ -0,0 +1,109 @@
1+diff -ur hackage-package-unix-2.7.2.2/configure ghc-package-unix-2.7.2.2/configure
2+--- hackage-package-unix-2.7.2.2/configure 2017-07-20 06:04:36.000000000 +0800
3++++ ghc-package-unix-2.7.2.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -667,7 +667,6 @@
5+ docdir
6+ oldincludedir
7+ includedir
8+-runstatedir
9+ localstatedir
10+ sharedstatedir
11+ sysconfdir
12+@@ -739,7 +738,6 @@
13+ sysconfdir='${prefix}/etc'
14+ sharedstatedir='${prefix}/com'
15+ localstatedir='${prefix}/var'
16+-runstatedir='${localstatedir}/run'
17+ includedir='${prefix}/include'
18+ oldincludedir='/usr/include'
19+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
20+@@ -992,15 +990,6 @@
21+ | -silent | --silent | --silen | --sile | --sil)
22+ silent=yes ;;
23+
24+- -runstatedir | --runstatedir | --runstatedi | --runstated \
25+- | --runstate | --runstat | --runsta | --runst | --runs \
26+- | --run | --ru | --r)
27+- ac_prev=runstatedir ;;
28+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
29+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
30+- | --run=* | --ru=* | --r=*)
31+- runstatedir=$ac_optarg ;;
32+-
33+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
34+ ac_prev=sbindir ;;
35+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
36+@@ -1138,7 +1127,7 @@
37+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
38+ datadir sysconfdir sharedstatedir localstatedir includedir \
39+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
40+- libdir localedir mandir runstatedir
41++ libdir localedir mandir
42+ do
43+ eval ac_val=\$$ac_var
44+ # Remove trailing slashes.
45+@@ -1291,7 +1280,6 @@
46+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
47+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
48+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
49+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
50+ --libdir=DIR object code libraries [EPREFIX/lib]
51+ --includedir=DIR C header files [PREFIX/include]
52+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
53+@@ -3782,7 +3770,7 @@
54+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
55+ since some C++ compilers masquerading as C compilers
56+ incorrectly reject 9223372036854775807. */
57+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
58++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
59+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
60+ && LARGE_OFF_T % 2147483647 == 1)
61+ ? 1 : -1];
62+@@ -3828,7 +3816,7 @@
63+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
64+ since some C++ compilers masquerading as C compilers
65+ incorrectly reject 9223372036854775807. */
66+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
67++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
68+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
69+ && LARGE_OFF_T % 2147483647 == 1)
70+ ? 1 : -1];
71+@@ -3852,7 +3840,7 @@
72+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
73+ since some C++ compilers masquerading as C compilers
74+ incorrectly reject 9223372036854775807. */
75+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
76++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
77+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
78+ && LARGE_OFF_T % 2147483647 == 1)
79+ ? 1 : -1];
80+@@ -3897,7 +3885,7 @@
81+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
82+ since some C++ compilers masquerading as C compilers
83+ incorrectly reject 9223372036854775807. */
84+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
85++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
86+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
87+ && LARGE_OFF_T % 2147483647 == 1)
88+ ? 1 : -1];
89+@@ -3921,7 +3909,7 @@
90+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
91+ since some C++ compilers masquerading as C compilers
92+ incorrectly reject 9223372036854775807. */
93+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
94++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
95+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
96+ && LARGE_OFF_T % 2147483647 == 1)
97+ ? 1 : -1];
98+diff -ur hackage-package-unix-2.7.2.2/unix.cabal ghc-package-unix-2.7.2.2/unix.cabal
99+--- hackage-package-unix-2.7.2.2/unix.cabal 2017-07-20 06:04:36.000000000 +0800
100++++ ghc-package-unix-2.7.2.2/unix.cabal 2001-09-09 09:46:40.000000000 +0800
101+@@ -62,7 +62,7 @@
102+ buildable: False
103+
104+ build-depends:
105+- base >= 4.5 && < 4.11,
106++ base >= 4.5 && < 4.12,
107+ bytestring >= 0.9.2 && < 0.11,
108+ time >= 1.2 && < 1.9
109+
patches/ghc841/vector-0.11.0.0.patchnew file+508
@@ -0,0 +1,508 @@
1+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs
2+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
3++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -101,12 +101,20 @@
5+ scanl, scanl1,
6+ enumFromTo, enumFromThenTo )
7+
8+-import Data.Int ( Int8, Int16, Int32, Int64 )
9+-import Data.Word ( Word8, Word16, Word32, Word, Word64 )
10++import Data.Int ( Int8, Int16, Int32 )
11++import Data.Word ( Word8, Word16, Word32, Word64 )
12++
13++#if !MIN_VERSION_base(4,8,0)
14++import Data.Word ( Word )
15++#endif
16+
17+ #include "vector.h"
18+ #include "MachDeps.h"
19+
20++#if WORD_SIZE_IN_BITS > 32
21++import Data.Int ( Int64 )
22++#endif
23++
24+ data Chunk v a = Chunk Int (forall m. (PrimMonad m, Vector v a) => Mutable v (PrimState m) a -> m ())
25+
26+ -- | Monadic streams
27+@@ -888,6 +896,7 @@
28+ :: Monad m => Integer -> Integer -> Bundle m v Integer #-}
29+
30+
31++#if WORD_SIZE_IN_BITS > 32
32+
33+ -- FIXME: the "too large" test is totally wrong
34+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Bundle m v a
35+@@ -906,7 +915,6 @@
36+ step z | z <= y = return $ Yield z (z+1)
37+ | otherwise = return $ Done
38+
39+-#if WORD_SIZE_IN_BITS > 32
40+
41+ {-# RULES
42+
43+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs
44+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2015-07-13 12:26:16.000000000 +0800
45++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2001-09-09 09:46:40.000000000 +0800
46+@@ -111,7 +111,7 @@
47+ type MBundle = M.Bundle
48+
49+ inplace :: (forall m. Monad m => S.Stream m a -> S.Stream m b)
50+- -> (Size -> Size) -> Bundle v a -> Bundle v b
51++ -> (Size -> Size) -> Bundle v a -> Bundle v b
52+ {-# INLINE_FUSED inplace #-}
53+ inplace f g b = b `seq` M.fromStream (f (M.elements b)) (g (M.size b))
54+
55+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs
56+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
57++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
58+@@ -89,8 +89,12 @@
59+ scanl, scanl1,
60+ enumFromTo, enumFromThenTo )
61+
62+-import Data.Int ( Int8, Int16, Int32, Int64 )
63++import Data.Int ( Int8, Int16, Int32 )
64++import Data.Word ( Word8, Word16, Word32, Word64 )
65++
66++#if !MIN_VERSION_base(4,8,0)
67+ import Data.Word ( Word8, Word16, Word32, Word, Word64 )
68++#endif
69+
70+ #if __GLASGOW_HASKELL__ >= 708
71+ import GHC.Types ( SPEC(..) )
72+@@ -101,6 +105,10 @@
73+ #include "vector.h"
74+ #include "MachDeps.h"
75+
76++#if WORD_SIZE_IN_BITS > 32
77++import Data.Int ( Int64 )
78++#endif
79++
80+ #if __GLASGOW_HASKELL__ < 708
81+ data SPEC = SPEC | SPEC2
82+ #if __GLASGOW_HASKELL__ >= 700
83+@@ -1403,6 +1411,8 @@
84+
85+
86+
87++#if WORD_SIZE_IN_BITS > 32
88++
89+ -- FIXME: the "too large" test is totally wrong
90+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Stream m a
91+ {-# INLINE_FUSED enumFromTo_big_int #-}
92+@@ -1412,8 +1422,6 @@
93+ step z | z <= y = return $ Yield z (z+1)
94+ | otherwise = return $ Done
95+
96+-#if WORD_SIZE_IN_BITS > 32
97+-
98+ {-# RULES
99+
100+ "enumFromTo<Int64> [Stream]"
101+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs
102+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2015-07-13 12:26:16.000000000 +0800
103++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2001-09-09 09:46:40.000000000 +0800
104+@@ -1,3 +1,4 @@
105++{-# LANGUAGE CPP #-}
106+ -- |
107+ -- Module : Data.Vector.Fusion.Util
108+ -- Copyright : (c) Roman Leshchinskiy 2009
109+@@ -16,7 +17,9 @@
110+ delay_inline, delayed_min
111+ ) where
112+
113++#if !MIN_VERSION_base(4,8,0)
114+ import Control.Applicative (Applicative(..))
115++#endif
116+
117+ -- | Identity monad
118+ newtype Id a = Id { unId :: a }
119+@@ -29,7 +32,7 @@
120+ Id f <*> Id x = Id (f x)
121+
122+ instance Monad Id where
123+- return = Id
124++ return = pure
125+ Id x >>= f = f x
126+
127+ -- | Box monad
128+@@ -43,7 +46,7 @@
129+ Box f <*> Box x = Box (f x)
130+
131+ instance Monad Box where
132+- return = Box
133++ return = pure
134+ Box x >>= f = f x
135+
136+ -- | Delay inlining a function until late in the game (simplifier phase 0).
137+@@ -55,4 +58,3 @@
138+ delayed_min :: Int -> Int -> Int
139+ {-# INLINE [0] delayed_min #-}
140+ delayed_min m n = min m n
141+-
142+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs
143+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
144++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
145+@@ -584,7 +584,7 @@
146+ new n = BOUNDS_CHECK(checkLength) "new" n
147+ $ unsafeNew n >>= \v -> basicInitialize v >> return v
148+
149+--- | Create a mutable vector of the given length. The length is not checked.
150++-- | Create a mutable vector of the given length. The memory is not initialized.
151+ unsafeNew :: (PrimMonad m, MVector v a) => Int -> m (v (PrimState m) a)
152+ {-# INLINE unsafeNew #-}
153+ unsafeNew n = UNSAFE_CHECK(checkLength) "unsafeNew" n
154+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs
155+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs 2015-07-13 12:26:16.000000000 +0800
156++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs 2001-09-09 09:46:40.000000000 +0800
157+@@ -1038,7 +1038,7 @@
158+ imapM_ f = Bundle.mapM_ (uncurry f) . Bundle.indexed . stream
159+
160+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
161+--- vector of results. Equvalent to @flip 'mapM'@.
162++-- vector of results. Equivalent to @flip 'mapM'@.
163+ forM :: (Monad m, Vector v a, Vector v b) => v a -> (a -> m b) -> m (v b)
164+ {-# INLINE forM #-}
165+ forM as f = mapM f as
166+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs
167+--- hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
168++++ ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
169+@@ -268,7 +268,7 @@
170+ {-# INLINE new #-}
171+ new = G.new
172+
173+--- | Create a mutable vector of the given length. The length is not checked.
174++-- | Create a mutable vector of the given length. The memory is not initialized.
175+ unsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) a)
176+ {-# INLINE unsafeNew #-}
177+ unsafeNew = G.unsafeNew
178+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs
179+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
180++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
181+@@ -211,7 +211,7 @@
182+ {-# INLINE new #-}
183+ new = G.new
184+
185+--- | Create a mutable vector of the given length. The length is not checked.
186++-- | Create a mutable vector of the given length. The memory is not initialized.
187+ unsafeNew :: (PrimMonad m, Prim a) => Int -> m (MVector (PrimState m) a)
188+ {-# INLINE unsafeNew #-}
189+ unsafeNew = G.unsafeNew
190+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs
191+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2015-07-13 12:26:16.000000000 +0800
192++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2001-09-09 09:46:40.000000000 +0800
193+@@ -164,7 +164,9 @@
194+ import Data.Data ( Data(..) )
195+ import Text.Read ( Read(..), readListPrecDefault )
196+
197++#if !MIN_VERSION_base(4,8,0)
198+ import Data.Monoid ( Monoid(..) )
199++#endif
200+
201+ #if __GLASGOW_HASKELL__ >= 708
202+ import qualified GHC.Exts as Exts
203+@@ -773,7 +775,7 @@
204+ mapM_ = G.mapM_
205+
206+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
207+--- vector of results. Equvalent to @flip 'mapM'@.
208++-- vector of results. Equivalent to @flip 'mapM'@.
209+ forM :: (Monad m, Prim a, Prim b) => Vector a -> (a -> m b) -> m (Vector b)
210+ {-# INLINE forM #-}
211+ forM = G.forM
212+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs
213+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
214++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
215+@@ -1,4 +1,4 @@
216+-{-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, ScopedTypeVariables #-}
217++{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, MagicHash, MultiParamTypeClasses, ScopedTypeVariables #-}
218+
219+ -- |
220+ -- Module : Data.Vector.Storable.Mutable
221+@@ -65,8 +65,13 @@
222+ import Foreign.Storable
223+ import Foreign.ForeignPtr
224+
225+-#if __GLASGOW_HASKELL__ >= 605
226+-import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
227++#if __GLASGOW_HASKELL__ >= 706
228++import GHC.ForeignPtr (mallocPlainForeignPtrAlignedBytes)
229++#elif __GLASGOW_HASKELL__ >= 700
230++import Data.Primitive.ByteArray (MutableByteArray(..), newAlignedPinnedByteArray,
231++ unsafeFreezeByteArray)
232++import GHC.Prim (byteArrayContents#, unsafeCoerce#)
233++import GHC.ForeignPtr
234+ #endif
235+
236+ import Foreign.Ptr
237+@@ -201,11 +206,26 @@
238+ {-# INLINE mallocVector #-}
239+ mallocVector :: Storable a => Int -> IO (ForeignPtr a)
240+ mallocVector =
241+-#if __GLASGOW_HASKELL__ >= 605
242+- doMalloc undefined
243+- where
244+- doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
245+- doMalloc dummy size = mallocPlainForeignPtrBytes (size * sizeOf dummy)
246++#if __GLASGOW_HASKELL__ >= 706
247++ doMalloc undefined
248++ where
249++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
250++ doMalloc dummy size =
251++ mallocPlainForeignPtrAlignedBytes (size * sizeOf dummy) (alignment dummy)
252++#elif __GLASGOW_HASKELL__ >= 700
253++ doMalloc undefined
254++ where
255++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
256++ doMalloc dummy size = do
257++ arr@(MutableByteArray arr#) <- newAlignedPinnedByteArray arrSize arrAlign
258++ newConcForeignPtr
259++ (Ptr (byteArrayContents# (unsafeCoerce# arr#)))
260++ -- Keep reference to mutable byte array until whole ForeignPtr goes out
261++ -- of scope.
262++ (touch arr)
263++ where
264++ arrSize = size * sizeOf dummy
265++ arrAlign = alignment dummy
266+ #else
267+ mallocForeignPtrArray
268+ #endif
269+@@ -293,7 +313,7 @@
270+ {-# INLINE new #-}
271+ new = G.new
272+
273+--- | Create a mutable vector of the given length. The length is not checked.
274++-- | Create a mutable vector of the given length. The memory is not initialized.
275+ unsafeNew :: (PrimMonad m, Storable a) => Int -> m (MVector (PrimState m) a)
276+ {-# INLINE unsafeNew #-}
277+ unsafeNew = G.unsafeNew
278+@@ -322,14 +342,14 @@
279+ -- | Grow a vector by the given number of elements. The number must be
280+ -- positive.
281+ grow :: (PrimMonad m, Storable a)
282+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
283++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
284+ {-# INLINE grow #-}
285+ grow = G.grow
286+
287+ -- | Grow a vector by the given number of elements. The number must be
288+ -- positive but this is not checked.
289+ unsafeGrow :: (PrimMonad m, Storable a)
290+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
291++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
292+ {-# INLINE unsafeGrow #-}
293+ unsafeGrow = G.unsafeGrow
294+
295+@@ -401,7 +421,7 @@
296+ -- | Copy a vector. The two vectors must have the same length and may not
297+ -- overlap.
298+ copy :: (PrimMonad m, Storable a)
299+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
300++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
301+ {-# INLINE copy #-}
302+ copy = G.copy
303+
304+@@ -422,7 +442,7 @@
305+ -- copied to a temporary vector and then the temporary vector was copied
306+ -- to the target vector.
307+ move :: (PrimMonad m, Storable a)
308+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
309++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
310+ {-# INLINE move #-}
311+ move = G.move
312+
313+@@ -434,9 +454,9 @@
314+ -- copied to a temporary vector and then the temporary vector was copied
315+ -- to the target vector.
316+ unsafeMove :: (PrimMonad m, Storable a)
317+- => MVector (PrimState m) a -- ^ target
318+- -> MVector (PrimState m) a -- ^ source
319+- -> m ()
320++ => MVector (PrimState m) a -- ^ target
321++ -> MVector (PrimState m) a -- ^ source
322++ -> m ()
323+ {-# INLINE unsafeMove #-}
324+ unsafeMove = G.unsafeMove
325+
326+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs
327+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs 2015-07-13 12:26:16.000000000 +0800
328++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs 2001-09-09 09:46:40.000000000 +0800
329+@@ -169,7 +169,9 @@
330+ import Data.Data ( Data(..) )
331+ import Text.Read ( Read(..), readListPrecDefault )
332+
333++#if !MIN_VERSION_base(4,8,0)
334+ import Data.Monoid ( Monoid(..) )
335++#endif
336+
337+ #if __GLASGOW_HASKELL__ >= 708
338+ import qualified GHC.Exts as Exts
339+@@ -783,7 +785,7 @@
340+ mapM_ = G.mapM_
341+
342+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
343+--- vector of results. Equvalent to @flip 'mapM'@.
344++-- vector of results. Equivalent to @flip 'mapM'@.
345+ forM :: (Monad m, Storable a, Storable b) => Vector a -> (a -> m b) -> m (Vector b)
346+ {-# INLINE forM #-}
347+ forM = G.forM
348+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs
349+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2015-07-13 12:26:16.000000000 +0800
350++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2001-09-09 09:46:40.000000000 +0800
351+@@ -30,10 +30,14 @@
352+ import Control.Monad.Primitive
353+ import Control.Monad ( liftM )
354+
355+-import Data.Word ( Word, Word8, Word16, Word32, Word64 )
356++import Data.Word ( Word8, Word16, Word32, Word64 )
357+ import Data.Int ( Int8, Int16, Int32, Int64 )
358+ import Data.Complex
359+
360++#if !MIN_VERSION_base(4,8,0)
361++import Data.Word ( Word )
362++#endif
363++
364+ #if __GLASGOW_HASKELL__ >= 707
365+ import Data.Typeable ( Typeable )
366+ #else
367+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs
368+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
369++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
370+@@ -149,7 +149,7 @@
371+ {-# INLINE new #-}
372+ new = G.new
373+
374+--- | Create a mutable vector of the given length. The length is not checked.
375++-- | Create a mutable vector of the given length. The memory is not initialized.
376+ unsafeNew :: (PrimMonad m, Unbox a) => Int -> m (MVector (PrimState m) a)
377+ {-# INLINE unsafeNew #-}
378+ unsafeNew = G.unsafeNew
379+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs
380+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2015-07-13 12:26:16.000000000 +0800
381++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2001-09-09 09:46:40.000000000 +0800
382+@@ -186,7 +186,9 @@
383+
384+ import Text.Read ( Read(..), readListPrecDefault )
385+
386++#if !MIN_VERSION_base(4,8,0)
387+ import Data.Monoid ( Monoid(..) )
388++#endif
389+
390+ #if __GLASGOW_HASKELL__ >= 708
391+ import qualified GHC.Exts as Exts (IsList(..))
392+@@ -820,7 +822,7 @@
393+ imapM_ = G.imapM_
394+
395+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
396+--- vector of results. Equvalent to @flip 'mapM'@.
397++-- vector of results. Equivalent to @flip 'mapM'@.
398+ forM :: (Monad m, Unbox a, Unbox b) => Vector a -> (a -> m b) -> m (Vector b)
399+ {-# INLINE forM #-}
400+ forM = G.forM
401+diff -ur hackage-package-vector-0.11.0.0/Data/Vector.hs ghc-package-vector-0.11.0.0/Data/Vector.hs
402+--- hackage-package-vector-0.11.0.0/Data/Vector.hs 2015-07-13 12:26:16.000000000 +0800
403++++ ghc-package-vector-0.11.0.0/Data/Vector.hs 2001-09-09 09:46:40.000000000 +0800
404+@@ -150,7 +150,7 @@
405+ -- * Conversions
406+
407+ -- ** Lists
408+- toList, fromList, fromListN,
409++ toList, Data.Vector.fromList, Data.Vector.fromListN,
410+
411+ -- ** Other vector types
412+ G.convert,
413+@@ -187,11 +187,14 @@
414+ import Data.Data ( Data(..) )
415+ import Text.Read ( Read(..), readListPrecDefault )
416+
417+-import Data.Monoid ( Monoid(..) )
418+ import qualified Control.Applicative as Applicative
419+ import qualified Data.Foldable as Foldable
420+ import qualified Data.Traversable as Traversable
421+
422++#if !MIN_VERSION_base(4,8,0)
423++import Data.Monoid ( Monoid(..) )
424++#endif
425++
426+ #if __GLASGOW_HASKELL__ >= 708
427+ import qualified GHC.Exts as Exts (IsList(..))
428+ #endif
429+@@ -220,8 +223,8 @@
430+
431+ instance Exts.IsList (Vector a) where
432+ type Item (Vector a) = a
433+- fromList = fromList
434+- fromListN = fromListN
435++ fromList = Data.Vector.fromList
436++ fromListN = Data.Vector.fromListN
437+ toList = toList
438+ #endif
439+
440+@@ -297,7 +300,7 @@
441+
442+ instance Monad Vector where
443+ {-# INLINE return #-}
444+- return = singleton
445++ return = Applicative.pure
446+
447+ {-# INLINE (>>=) #-}
448+ (>>=) = flip concatMap
449+@@ -341,7 +344,7 @@
450+
451+ instance Traversable.Traversable Vector where
452+ {-# INLINE traverse #-}
453+- traverse f xs = fromList Applicative.<$> Traversable.traverse f (toList xs)
454++ traverse f xs = Data.Vector.fromList Applicative.<$> Traversable.traverse f (toList xs)
455+
456+ {-# INLINE mapM #-}
457+ mapM = mapM
458+@@ -917,7 +920,7 @@
459+ imapM_ = G.imapM_
460+
461+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
462+--- vector of results. Equvalent to @flip 'mapM'@.
463++-- vector of results. Equivalent to @flip 'mapM'@.
464+ forM :: Monad m => Vector a -> (a -> m b) -> m (Vector b)
465+ {-# INLINE forM #-}
466+ forM = G.forM
467+diff -ur hackage-package-vector-0.11.0.0/include/vector.h ghc-package-vector-0.11.0.0/include/vector.h
468+--- hackage-package-vector-0.11.0.0/include/vector.h 2015-07-13 12:26:16.000000000 +0800
469++++ ghc-package-vector-0.11.0.0/include/vector.h 2001-09-09 09:46:40.000000000 +0800
470+@@ -18,4 +18,3 @@
471+
472+ #define PHASE_STREAM Please use "PHASE_FUSED" instead
473+ #define INLINE_STREAM Please use "INLINE_FUSED" instead
474+-
475+diff -ur hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs
476+--- hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs 2015-07-13 12:26:16.000000000 +0800
477++++ ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs 2001-09-09 09:46:40.000000000 +0800
478+@@ -643,6 +643,7 @@
479+ testGroup "Data.Vector.Storable.Vector (Double)" (testNumericStorableVector (undefined :: Data.Vector.Storable.Vector Double)),
480+
481+ testGroup "Data.Vector.Unboxed.Vector ()" (testUnitUnboxedVector (undefined :: Data.Vector.Unboxed.Vector ())),
482++ testGroup "Data.Vector.Unboxed.Vector (Bool)" (testBoolUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Bool)),
483+ testGroup "Data.Vector.Unboxed.Vector (Int)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Int)),
484+ testGroup "Data.Vector.Unboxed.Vector (Double)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Double)),
485+ testGroup "Data.Vector.Unboxed.Vector (Int,Bool)" (testTupleUnboxedVector (undefined :: Data.Vector.Unboxed.Vector (Int,Bool))),
486+diff -ur hackage-package-vector-0.11.0.0/vector.cabal ghc-package-vector-0.11.0.0/vector.cabal
487+--- hackage-package-vector-0.11.0.0/vector.cabal 2015-07-13 12:26:16.000000000 +0800
488++++ ghc-package-vector-0.11.0.0/vector.cabal 2001-09-09 09:46:40.000000000 +0800
489+@@ -38,6 +38,7 @@
490+ Build-Type: Simple
491+
492+ Extra-Source-Files:
493++ changelog
494+ README.md
495+ tests/LICENSE
496+ tests/Setup.hs
497+@@ -137,9 +138,9 @@
498+ Install-Includes:
499+ vector.h
500+
501+- Build-Depends: base >= 4.3 && < 4.9
502++ Build-Depends: base >= 4.3 && < 4.10
503+ , primitive >= 0.5.0.1 && < 0.7
504+- , ghc-prim >= 0.2 && < 0.5
505++ , ghc-prim >= 0.2 && < 0.6
506+ , deepseq >= 1.1 && < 1.5
507+
508+ Ghc-Options: -O2 -Wall -fno-warn-orphans
patches/ghc841/xhtml-3000.2.2.patchnew file+20
@@ -0,0 +1,20 @@
1+diff -ur hackage-package-xhtml-3000.2.2/Text/XHtml/Internals.hs ghc-package-xhtml-3000.2.2/Text/XHtml/Internals.hs
2+--- hackage-package-xhtml-3000.2.2/Text/XHtml/Internals.hs 2017-06-18 04:51:30.000000000 +0800
3++++ ghc-package-xhtml-3000.2.2/Text/XHtml/Internals.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -17,6 +17,7 @@
5+
6+ import Data.Char
7+ import qualified Data.Semigroup as Sem
8++import qualified Data.Monoid as Mon
9+
10+ infixr 2 +++ -- combining Html
11+ infixr 7 << -- nesting Html
12+@@ -67,7 +68,7 @@
13+ instance Sem.Semigroup Html where
14+ (<>) = (+++)
15+
16+-instance Sem.Monoid Html where
17++instance Mon.Monoid Html where
18+ mempty = noHtml
19+ mappend = (Sem.<>)
20+
patches/ghc842/array-0.5.2.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-array-0.5.2.0/array.cabal ghc-package-array-0.5.2.0/array.cabal
2+--- hackage-package-array-0.5.2.0/array.cabal 2017-07-04 06:06:07.000000000 +0800
3++++ ghc-package-array-0.5.2.0/array.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -37,7 +37,7 @@
5+ Trustworthy,
6+ UnboxedTuples,
7+ UnliftedFFITypes
8+- build-depends: base >= 4.7 && < 4.11
9++ build-depends: base >= 4.7 && < 4.12
10+ ghc-options: -Wall
11+ exposed-modules:
12+ Data.Array
patches/ghc842/deepseq-1.4.3.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-deepseq-1.4.3.0/deepseq.cabal ghc-package-deepseq-1.4.3.0/deepseq.cabal
2+--- hackage-package-deepseq-1.4.3.0/deepseq.cabal 2017-07-20 06:00:58.000000000 +0800
3++++ ghc-package-deepseq-1.4.3.0/deepseq.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -61,7 +61,7 @@
5+ if impl(ghc>=7.8)
6+ other-extensions: EmptyCase
7+
8+- build-depends: base >= 4.5 && < 4.11,
9++ build-depends: base >= 4.5 && < 4.12,
10+ array >= 0.4 && < 0.6
11+ ghc-options: -Wall
12+
patches/ghc842/default.nixnew file+12
@@ -0,0 +1,12 @@
1+{
2+ packages.array.patches = [ ./array-0.5.2.0.patch ];
3+ packages.deepseq.patches = [ ./deepseq-1.4.3.0.patch ];
4+ packages.default.nix.patches = [ ./default.nix ];
5+ packages.hpc.patches = [ ./hpc-0.6.0.3.patch ];
6+ packages.parallel.patches = [ ./parallel-3.2.1.1.patch ];
7+ packages.parsec.patches = [ ./parsec-3.1.13.0.patch ];
8+ packages.random.patches = [ ./random-1.1.patch ];
9+ packages.time.patches = [ ./time-1.8.0.2.patch ];
10+ packages.unix.patches = [ ./unix-2.7.2.2.patch ];
11+ packages.vector.patches = [ ./vector-0.11.0.0.patch ];
12+}
patches/ghc842/hpc-0.6.0.3.patchnew file+16
@@ -0,0 +1,16 @@
1+diff -ur hackage-package-hpc-0.6.0.3/hpc.cabal ghc-package-hpc-0.6.0.3/hpc.cabal
2+--- hackage-package-hpc-0.6.0.3/hpc.cabal 2016-05-04 18:47:19.000000000 +0800
3++++ ghc-package-hpc-0.6.0.3/hpc.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -35,9 +35,9 @@
5+ Trace.Hpc.Reflect
6+
7+ Build-Depends:
8+- base >= 4.4.1 && < 4.10,
9++ base >= 4.4.1 && < 4.12,
10+ containers >= 0.4.1 && < 0.6,
11+- directory >= 1.1 && < 1.3,
12++ directory >= 1.1 && < 1.4,
13+ filepath >= 1 && < 1.5,
14+- time >= 1.2 && < 1.7
15++ time >= 1.2 && < 1.9
16+ ghc-options: -Wall
patches/ghc842/parallel-3.2.1.1.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-parallel-3.2.1.1/parallel.cabal ghc-package-parallel-3.2.1.1/parallel.cabal
2+--- hackage-package-parallel-3.2.1.1/parallel.cabal 2017-04-09 00:25:01.000000000 +0800
3++++ ghc-package-parallel-3.2.1.1/parallel.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -34,7 +34,7 @@
5+
6+ build-depends:
7+ array >= 0.3 && < 0.6,
8+- base >= 4.3 && < 4.11,
9++ base >= 4.3 && < 4.12,
10+ containers >= 0.4 && < 0.6,
11+ deepseq >= 1.1 && < 1.5
12+
patches/ghc842/parsec-3.1.13.0.patchnew file+23
@@ -0,0 +1,23 @@
1+diff -ur hackage-package-parsec-3.1.13.0/parsec.cabal ghc-package-parsec-3.1.13.0/parsec.cabal
2+--- hackage-package-parsec-3.1.13.0/parsec.cabal 2018-02-06 17:13:02.000000000 +0800
3++++ ghc-package-parsec-3.1.13.0/parsec.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -21,8 +21,8 @@
5+ license-file: LICENSE
6+ author: Daan Leijen <daan@microsoft.com>, Paolo Martini <paolo@nemail.it>, Antoine Latter <aslatter@gmail.com>
7+ maintainer: Herbert Valerio Riedel <hvr@gnu.org>
8+-homepage: https://github.com/hvr/parsec
9+-bug-reports: https://github.com/hvr/parsec/issues
10++homepage: https://github.com/haskell/parsec
11++bug-reports: https://github.com/haskell/parsec/issues
12+ category: Parsing
13+
14+ build-type: Simple
15+@@ -32,7 +32,7 @@
16+
17+ source-repository head
18+ type: git
19+- location: https://github.com/hvr/parsec
20++ location: https://github.com/haskell/parsec
21+
22+ library
23+ hs-source-dirs: src
patches/ghc842/random-1.1.patchnew file+406
@@ -0,0 +1,406 @@
1+diff -ur hackage-package-random-1.1/README.md ghc-package-random-1.1/README.md
2+--- hackage-package-random-1.1/README.md 2014-09-17 05:34:43.000000000 +0800
3++++ ghc-package-random-1.1/README.md 2001-09-09 09:46:40.000000000 +0800
4+@@ -10,7 +10,7 @@
5+
6+ A module supplying this interface is required for Haskell 98 (but not Haskell
7+ 2010). An older [version]
8+-(http://www.haskell.org/ghc/docs/latest/html/libraries/haskell98/Random.html)
9++(https://downloads.haskell.org/~ghc/latest/docs/html/libraries/haskell98-2.0.0.3/Random.html)
10+ of this library is included with GHC in the haskell98 package. This newer
11+ version, with compatible api, is included in the [Haskell Platform]
12+ (http://www.haskell.org/platform/contents.html).
13+diff -ur hackage-package-random-1.1/System/Random.hs ghc-package-random-1.1/System/Random.hs
14+--- hackage-package-random-1.1/System/Random.hs 2014-09-17 05:34:43.000000000 +0800
15++++ ghc-package-random-1.1/System/Random.hs 2001-09-09 09:46:40.000000000 +0800
16+@@ -7,7 +7,7 @@
17+ -- Module : System.Random
18+ -- Copyright : (c) The University of Glasgow 2001
19+ -- License : BSD-style (see the file LICENSE in the 'random' repository)
20+---
21++--
22+ -- Maintainer : libraries@haskell.org
23+ -- Stability : stable
24+ -- Portability : portable
25+@@ -18,7 +18,7 @@
26+ -- or to get different results on each run by using the system-initialised
27+ -- generator or by supplying a seed from some other source.
28+ --
29+--- The library is split into two layers:
30++-- The library is split into two layers:
31+ --
32+ -- * A core /random number generator/ provides a supply of bits.
33+ -- The class 'RandomGen' provides a common interface to such generators.
34+@@ -40,40 +40,40 @@
35+ #include "MachDeps.h"
36+
37+ module System.Random
38+- (
39++ (
40+
41+- -- $intro
42++ -- $intro
43+
44+- -- * Random number generators
45++ -- * Random number generators
46+
47+ #ifdef ENABLE_SPLITTABLEGEN
48+- RandomGen(next, genRange)
49+- , SplittableGen(split)
50++ RandomGen(next, genRange)
51++ , SplittableGen(split)
52+ #else
53+- RandomGen(next, genRange, split)
54++ RandomGen(next, genRange, split)
55+ #endif
56+- -- ** Standard random number generators
57+- , StdGen
58+- , mkStdGen
59++ -- ** Standard random number generators
60++ , StdGen
61++ , mkStdGen
62+
63+- -- ** The global random number generator
64++ -- ** The global random number generator
65+
66+- -- $globalrng
67++ -- $globalrng
68+
69+- , getStdRandom
70+- , getStdGen
71+- , setStdGen
72+- , newStdGen
73++ , getStdRandom
74++ , getStdGen
75++ , setStdGen
76++ , newStdGen
77+
78+- -- * Random values of various types
79+- , Random ( random, randomR,
80+- randoms, randomRs,
81+- randomIO, randomRIO )
82++ -- * Random values of various types
83++ , Random ( random, randomR,
84++ randoms, randomRs,
85++ randomIO, randomRIO )
86+
87+- -- * References
88+- -- $references
89++ -- * References
90++ -- $references
91+
92+- ) where
93++ ) where
94+
95+ import Prelude
96+
97+@@ -83,15 +83,15 @@
98+ import Foreign.C.Types
99+
100+ #ifdef __NHC__
101+-import CPUTime ( getCPUTime )
102++import CPUTime ( getCPUTime )
103+ import Foreign.Ptr ( Ptr, nullPtr )
104+-import Foreign.C ( CTime, CUInt )
105++import Foreign.C ( CTime, CUInt )
106+ #else
107+-import System.CPUTime ( getCPUTime )
108+-import Data.Time ( getCurrentTime, UTCTime(..) )
109++import System.CPUTime ( getCPUTime )
110++import Data.Time ( getCurrentTime, UTCTime(..) )
111+ import Data.Ratio ( numerator, denominator )
112+ #endif
113+-import Data.Char ( isSpace, chr, ord )
114++import Data.Char ( isSpace, chr, ord )
115+ import System.IO.Unsafe ( unsafePerformIO )
116+ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
117+ #if MIN_VERSION_base (4,6,0)
118+@@ -99,7 +99,7 @@
119+ #else
120+ import Data.IORef ( atomicModifyIORef )
121+ #endif
122+-import Numeric ( readDec )
123++import Numeric ( readDec )
124+
125+ #ifdef __GLASGOW_HASKELL__
126+ import GHC.Exts ( build )
127+@@ -201,17 +201,17 @@
128+
129+ In addition, 'reads' may be used to map an arbitrary string (not necessarily one
130+ produced by 'show') onto a value of type 'StdGen'. In general, the 'Read'
131+-instance of 'StdGen' has the following properties:
132++instance of 'StdGen' has the following properties:
133+
134+-* It guarantees to succeed on any string.
135++* It guarantees to succeed on any string.
136+
137+-* It guarantees to consume only a finite portion of the string.
138++* It guarantees to consume only a finite portion of the string.
139+
140+ * Different argument strings are likely to result in different results.
141+
142+ -}
143+
144+-data StdGen
145++data StdGen
146+ = StdGen !Int32 !Int32
147+
148+ instance RandomGen StdGen where
149+@@ -224,8 +224,8 @@
150+ split = stdSplit
151+
152+ instance Show StdGen where
153+- showsPrec p (StdGen s1 s2) =
154+- showsPrec p s1 .
155++ showsPrec p (StdGen s1 s2) =
156++ showsPrec p s1 .
157+ showChar ' ' .
158+ showsPrec p s2
159+
160+@@ -234,11 +234,11 @@
161+ case try_read r of
162+ r'@[_] -> r'
163+ _ -> [stdFromString r] -- because it shouldn't ever fail.
164+- where
165++ where
166+ try_read r = do
167+ (s1, r1) <- readDec (dropWhile isSpace r)
168+- (s2, r2) <- readDec (dropWhile isSpace r1)
169+- return (StdGen s1 s2, r2)
170++ (s2, r2) <- readDec (dropWhile isSpace r1)
171++ return (StdGen s1 s2, r2)
172+
173+ {-
174+ If we cannot unravel the StdGen from a string, create
175+@@ -246,7 +246,7 @@
176+ -}
177+ stdFromString :: String -> (StdGen, String)
178+ stdFromString s = (mkStdGen num, rest)
179+- where (cs, rest) = splitAt 6 s
180++ where (cs, rest) = splitAt 6 s
181+ num = foldl (\a x -> x + 3 * a) 1 (map ord cs)
182+
183+
184+@@ -266,11 +266,11 @@
185+ mkStdGen32 :: Int32 -> StdGen
186+ mkStdGen32 sMaybeNegative = StdGen (s1+1) (s2+1)
187+ where
188+- -- We want a non-negative number, but we can't just take the abs
189+- -- of sMaybeNegative as -minBound == minBound.
190+- s = sMaybeNegative .&. maxBound
191+- (q, s1) = s `divMod` 2147483562
192+- s2 = q `mod` 2147483398
193++ -- We want a non-negative number, but we can't just take the abs
194++ -- of sMaybeNegative as -minBound == minBound.
195++ s = sMaybeNegative .&. maxBound
196++ (q, s1) = s `divMod` 2147483562
197++ s2 = q `mod` 2147483398
198+
199+ createStdGen :: Integer -> StdGen
200+ createStdGen s = mkStdGen32 $ fromIntegral s
201+@@ -323,7 +323,7 @@
202+ -- | A variant of 'random' that uses the global random number generator
203+ -- (see "System.Random#globalrng").
204+ randomIO :: IO a
205+- randomIO = getStdRandom random
206++ randomIO = getStdRandom random
207+
208+ -- | Produce an infinite list-equivalent of random values.
209+ {-# INLINE buildRandoms #-}
210+@@ -340,7 +340,7 @@
211+
212+ instance Random Integer where
213+ randomR ival g = randomIvalInteger ival g
214+- random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
215++ random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
216+
217+ instance Random Int where randomR = randomIvalIntegral; random = randomBounded
218+ instance Random Int8 where randomR = randomIvalIntegral; random = randomBounded
219+@@ -378,13 +378,13 @@
220+ instance Random CUIntMax where randomR = randomIvalIntegral; random = randomBounded
221+
222+ instance Random Char where
223+- randomR (a,b) g =
224++ randomR (a,b) g =
225+ case (randomIvalInteger (toInteger (ord a), toInteger (ord b)) g) of
226+ (x,g') -> (chr x, g')
227+- random g = randomR (minBound,maxBound) g
228++ random g = randomR (minBound,maxBound) g
229+
230+ instance Random Bool where
231+- randomR (a,b) g =
232++ randomR (a,b) g =
233+ case (randomIvalInteger (bool2Int a, bool2Int b) g) of
234+ (x, g') -> (int2Bool x, g')
235+ where
236+@@ -392,42 +392,42 @@
237+ bool2Int False = 0
238+ bool2Int True = 1
239+
240+- int2Bool :: Int -> Bool
241+- int2Bool 0 = False
242+- int2Bool _ = True
243++ int2Bool :: Int -> Bool
244++ int2Bool 0 = False
245++ int2Bool _ = True
246+
247+- random g = randomR (minBound,maxBound) g
248++ random g = randomR (minBound,maxBound) g
249+
250+ {-# INLINE randomRFloating #-}
251+ randomRFloating :: (Fractional a, Num a, Ord a, Random a, RandomGen g) => (a, a) -> g -> (a, g)
252+-randomRFloating (l,h) g
253++randomRFloating (l,h) g
254+ | l>h = randomRFloating (h,l) g
255+- | otherwise = let (coef,g') = random g in
256+- (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
257++ | otherwise = let (coef,g') = random g in
258++ (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
259+
260+ instance Random Double where
261+ randomR = randomRFloating
262+- random rng =
263+- case random rng of
264+- (x,rng') ->
265++ random rng =
266++ case random rng of
267++ (x,rng') ->
268+ -- We use 53 bits of randomness corresponding to the 53 bit significand:
269+- ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
270+- / fromIntegral twoto53, rng')
271+- where
272++ ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
273++ / fromIntegral twoto53, rng')
274++ where
275+ twoto53 = (2::Int64) ^ (53::Int64)
276+ mask53 = twoto53 - 1
277+-
278++
279+ instance Random Float where
280+ randomR = randomRFloating
281+- random rng =
282+- -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
283+- case random rng of
284+- (x,rng') ->
285++ random rng =
286++ -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
287++ case random rng of
288++ (x,rng') ->
289+ -- We use 24 bits of randomness corresponding to the 24 bit significand:
290+- ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
291+- / fromIntegral twoto24, rng')
292+- -- Note, encodeFloat is another option, but I'm not seeing slightly
293+- -- worse performance with the following [2011.06.25]:
294++ ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
295++ / fromIntegral twoto24, rng')
296++ -- Note, encodeFloat is another option, but I'm not seeing slightly
297++ -- worse performance with the following [2011.06.25]:
298+ -- (encodeFloat rand (-24), rng')
299+ where
300+ mask24 = twoto24 - 1
301+@@ -436,8 +436,8 @@
302+ -- CFloat/CDouble are basically the same as a Float/Double:
303+ instance Random CFloat where
304+ randomR = randomRFloating
305+- random rng = case random rng of
306+- (x,rng') -> (realToFrac (x::Float), rng')
307++ random rng = case random rng of
308++ (x,rng') -> (realToFrac (x::Float), rng')
309+
310+ instance Random CDouble where
311+ randomR = randomRFloating
312+@@ -445,8 +445,8 @@
313+ -- Presently, this is showing better performance than the Double instance:
314+ -- (And yet, if the Double instance uses randomFrac then its performance is much worse!)
315+ random = randomFrac
316+- -- random rng = case random rng of
317+- -- (x,rng') -> (realToFrac (x::Double), rng')
318++ -- random rng = case random rng of
319++ -- (x,rng') -> (realToFrac (x::Double), rng')
320+
321+ mkStdRNG :: Integer -> IO StdGen
322+ mkStdRNG o = do
323+@@ -463,7 +463,7 @@
324+
325+ {-# SPECIALIZE randomIvalInteger :: (Num a) =>
326+ (Integer, Integer) -> StdGen -> (a, StdGen) #-}
327+-
328++
329+ randomIvalInteger :: (RandomGen g, Num a) => (Integer, Integer) -> g -> (a, g)
330+ randomIvalInteger (l,h) rng
331+ | l > h = randomIvalInteger (h,l) rng
332+@@ -482,7 +482,7 @@
333+ k = h - l + 1
334+ magtgt = k * q
335+
336+- -- generate random values until we exceed the target magnitude
337++ -- generate random values until we exceed the target magnitude
338+ f mag v g | mag >= magtgt = (v, g)
339+ | otherwise = v' `seq`f (mag*b) v' g' where
340+ (x,g') = next g
341+@@ -494,18 +494,18 @@
342+ randomFrac = randomIvalDouble (0::Double,1) realToFrac
343+
344+ randomIvalDouble :: (RandomGen g, Fractional a) => (Double, Double) -> (Double -> a) -> g -> (a, g)
345+-randomIvalDouble (l,h) fromDouble rng
346++randomIvalDouble (l,h) fromDouble rng
347+ | l > h = randomIvalDouble (h,l) fromDouble rng
348+- | otherwise =
349++ | otherwise =
350+ case (randomIvalInteger (toInteger (minBound::Int32), toInteger (maxBound::Int32)) rng) of
351+- (x, rng') ->
352+- let
353+- scaled_x =
354+- fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
355++ (x, rng') ->
356++ let
357++ scaled_x =
358++ fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
359+ fromDouble ((0.5*h - 0.5*l) / (0.5 * realToFrac int32Count)) * -- avoid overflow
360+- fromIntegral (x::Int32)
361+- in
362+- (scaled_x, rng')
363++ fromIntegral (x::Int32)
364++ in
365++ (scaled_x, rng')
366+
367+ int32Count :: Integer
368+ int32Count = toInteger (maxBound::Int32) - toInteger (minBound::Int32) + 1 -- GHC ticket #3982
369+@@ -516,16 +516,16 @@
370+ stdNext :: StdGen -> (Int, StdGen)
371+ -- Returns values in the range stdRange
372+ stdNext (StdGen s1 s2) = (fromIntegral z', StdGen s1'' s2'')
373+- where z' = if z < 1 then z + 2147483562 else z
374+- z = s1'' - s2''
375++ where z' = if z < 1 then z + 2147483562 else z
376++ z = s1'' - s2''
377+
378+- k = s1 `quot` 53668
379+- s1' = 40014 * (s1 - k * 53668) - k * 12211
380+- s1'' = if s1' < 0 then s1' + 2147483563 else s1'
381+-
382+- k' = s2 `quot` 52774
383+- s2' = 40692 * (s2 - k' * 52774) - k' * 3791
384+- s2'' = if s2' < 0 then s2' + 2147483399 else s2'
385++ k = s1 `quot` 53668
386++ s1' = 40014 * (s1 - k * 53668) - k * 12211
387++ s1'' = if s1' < 0 then s1' + 2147483563 else s1'
388++
389++ k' = s2 `quot` 52774
390++ s2' = 40692 * (s2 - k' * 52774) - k' * 3791
391++ s2'' = if s2' < 0 then s2' + 2147483399 else s2'
392+
393+ stdSplit :: StdGen -> (StdGen, StdGen)
394+ stdSplit std@(StdGen s1 s2)
395+diff -ur hackage-package-random-1.1/random.cabal ghc-package-random-1.1/random.cabal
396+--- hackage-package-random-1.1/random.cabal 2014-09-17 05:34:43.000000000 +0800
397++++ ghc-package-random-1.1/random.cabal 2001-09-09 09:46:40.000000000 +0800
398+@@ -40,7 +40,7 @@
399+
400+ source-repository head
401+ type: git
402+- location: http://git.haskell.org/packages/random.git
403++ location: https://github.com/haskell/random.git
404+
405+ -- To run the Test-Suite:
406+ -- $ cabal configure --enable-tests
patches/ghc842/time-1.8.0.2.patchnew file+146
@@ -0,0 +1,146 @@
1+diff -ur hackage-package-time-1.8.0.2/configure ghc-package-time-1.8.0.2/configure
2+--- hackage-package-time-1.8.0.2/configure 2016-12-07 03:31:54.000000000 +0800
3++++ ghc-package-time-1.8.0.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,6 +1,6 @@
5+ #! /bin/sh
6+ # Guess values for system-dependent variables and create Makefiles.
7+-# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.
8++# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.0.2.
9+ #
10+ # Report bugs to <ashley@semantic.org>.
11+ #
12+@@ -580,8 +580,8 @@
13+ # Identity of this package.
14+ PACKAGE_NAME='Haskell time package'
15+ PACKAGE_TARNAME='time'
16+-PACKAGE_VERSION='1.8'
17+-PACKAGE_STRING='Haskell time package 1.8'
18++PACKAGE_VERSION='1.8.0.2'
19++PACKAGE_STRING='Haskell time package 1.8.0.2'
20+ PACKAGE_BUGREPORT='ashley@semantic.org'
21+ PACKAGE_URL=''
22+
23+@@ -653,7 +653,6 @@
24+ docdir
25+ oldincludedir
26+ includedir
27+-runstatedir
28+ localstatedir
29+ sharedstatedir
30+ sysconfdir
31+@@ -726,7 +725,6 @@
32+ sysconfdir='${prefix}/etc'
33+ sharedstatedir='${prefix}/com'
34+ localstatedir='${prefix}/var'
35+-runstatedir='${localstatedir}/run'
36+ includedir='${prefix}/include'
37+ oldincludedir='/usr/include'
38+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
39+@@ -979,15 +977,6 @@
40+ | -silent | --silent | --silen | --sile | --sil)
41+ silent=yes ;;
42+
43+- -runstatedir | --runstatedir | --runstatedi | --runstated \
44+- | --runstate | --runstat | --runsta | --runst | --runs \
45+- | --run | --ru | --r)
46+- ac_prev=runstatedir ;;
47+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
48+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
49+- | --run=* | --ru=* | --r=*)
50+- runstatedir=$ac_optarg ;;
51+-
52+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
53+ ac_prev=sbindir ;;
54+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
55+@@ -1125,7 +1114,7 @@
56+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
57+ datadir sysconfdir sharedstatedir localstatedir includedir \
58+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
59+- libdir localedir mandir runstatedir
60++ libdir localedir mandir
61+ do
62+ eval ac_val=\$$ac_var
63+ # Remove trailing slashes.
64+@@ -1238,7 +1227,7 @@
65+ # Omit some internal or obsolete options to make the list less imposing.
66+ # This message is too long to be a string in the A/UX 3.1 sh.
67+ cat <<_ACEOF
68+-\`configure' configures Haskell time package 1.8 to adapt to many kinds of systems.
69++\`configure' configures Haskell time package 1.8.0.2 to adapt to many kinds of systems.
70+
71+ Usage: $0 [OPTION]... [VAR=VALUE]...
72+
73+@@ -1278,7 +1267,6 @@
74+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
75+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
76+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
77+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
78+ --libdir=DIR object code libraries [EPREFIX/lib]
79+ --includedir=DIR C header files [PREFIX/include]
80+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
81+@@ -1300,7 +1288,7 @@
82+
83+ if test -n "$ac_init_help"; then
84+ case $ac_init_help in
85+- short | recursive ) echo "Configuration of Haskell time package 1.8:";;
86++ short | recursive ) echo "Configuration of Haskell time package 1.8.0.2:";;
87+ esac
88+ cat <<\_ACEOF
89+
90+@@ -1386,7 +1374,7 @@
91+ test -n "$ac_init_help" && exit $ac_status
92+ if $ac_init_version; then
93+ cat <<\_ACEOF
94+-Haskell time package configure 1.8
95++Haskell time package configure 1.8.0.2
96+ generated by GNU Autoconf 2.69
97+
98+ Copyright (C) 2012 Free Software Foundation, Inc.
99+@@ -1858,7 +1846,7 @@
100+ This file contains any messages produced by compilers while
101+ running configure, to aid debugging if configure makes a mistake.
102+
103+-It was created by Haskell time package $as_me 1.8, which was
104++It was created by Haskell time package $as_me 1.8.0.2, which was
105+ generated by GNU Autoconf 2.69. Invocation command line was
106+
107+ $ $0 $@
108+@@ -4193,7 +4181,7 @@
109+ # report actual input values of CONFIG_FILES etc. instead of their
110+ # values after options handling.
111+ ac_log="
112+-This file was extended by Haskell time package $as_me 1.8, which was
113++This file was extended by Haskell time package $as_me 1.8.0.2, which was
114+ generated by GNU Autoconf 2.69. Invocation command line was
115+
116+ CONFIG_FILES = $CONFIG_FILES
117+@@ -4246,7 +4234,7 @@
118+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
119+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
120+ ac_cs_version="\\
121+-Haskell time package config.status 1.8
122++Haskell time package config.status 1.8.0.2
123+ configured by $0, generated by GNU Autoconf 2.69,
124+ with options \\"\$ac_cs_config\\"
125+
126+diff -ur hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h
127+--- hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2017-05-13 18:29:46.000000000 +0800
128++++ ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2001-09-09 09:46:40.000000000 +0800
129+@@ -69,7 +69,7 @@
130+ #define PACKAGE_NAME "Haskell time package"
131+
132+ /* Define to the full name and version of this package. */
133+-#define PACKAGE_STRING "Haskell time package 1.8"
134++#define PACKAGE_STRING "Haskell time package 1.8.0.2"
135+
136+ /* Define to the one symbol short name of this package. */
137+ #define PACKAGE_TARNAME "time"
138+@@ -78,7 +78,7 @@
139+ #define PACKAGE_URL ""
140+
141+ /* Define to the version of this package. */
142+-#define PACKAGE_VERSION "1.8"
143++#define PACKAGE_VERSION "1.8.0.2"
144+
145+ /* Define to 1 if you have the ANSI C header files. */
146+ #define STDC_HEADERS 1
patches/ghc842/unix-2.7.2.2.patchnew file+109
@@ -0,0 +1,109 @@
1+diff -ur hackage-package-unix-2.7.2.2/configure ghc-package-unix-2.7.2.2/configure
2+--- hackage-package-unix-2.7.2.2/configure 2017-07-20 06:04:36.000000000 +0800
3++++ ghc-package-unix-2.7.2.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -667,7 +667,6 @@
5+ docdir
6+ oldincludedir
7+ includedir
8+-runstatedir
9+ localstatedir
10+ sharedstatedir
11+ sysconfdir
12+@@ -739,7 +738,6 @@
13+ sysconfdir='${prefix}/etc'
14+ sharedstatedir='${prefix}/com'
15+ localstatedir='${prefix}/var'
16+-runstatedir='${localstatedir}/run'
17+ includedir='${prefix}/include'
18+ oldincludedir='/usr/include'
19+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
20+@@ -992,15 +990,6 @@
21+ | -silent | --silent | --silen | --sile | --sil)
22+ silent=yes ;;
23+
24+- -runstatedir | --runstatedir | --runstatedi | --runstated \
25+- | --runstate | --runstat | --runsta | --runst | --runs \
26+- | --run | --ru | --r)
27+- ac_prev=runstatedir ;;
28+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
29+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
30+- | --run=* | --ru=* | --r=*)
31+- runstatedir=$ac_optarg ;;
32+-
33+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
34+ ac_prev=sbindir ;;
35+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
36+@@ -1138,7 +1127,7 @@
37+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
38+ datadir sysconfdir sharedstatedir localstatedir includedir \
39+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
40+- libdir localedir mandir runstatedir
41++ libdir localedir mandir
42+ do
43+ eval ac_val=\$$ac_var
44+ # Remove trailing slashes.
45+@@ -1291,7 +1280,6 @@
46+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
47+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
48+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
49+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
50+ --libdir=DIR object code libraries [EPREFIX/lib]
51+ --includedir=DIR C header files [PREFIX/include]
52+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
53+@@ -3782,7 +3770,7 @@
54+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
55+ since some C++ compilers masquerading as C compilers
56+ incorrectly reject 9223372036854775807. */
57+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
58++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
59+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
60+ && LARGE_OFF_T % 2147483647 == 1)
61+ ? 1 : -1];
62+@@ -3828,7 +3816,7 @@
63+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
64+ since some C++ compilers masquerading as C compilers
65+ incorrectly reject 9223372036854775807. */
66+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
67++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
68+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
69+ && LARGE_OFF_T % 2147483647 == 1)
70+ ? 1 : -1];
71+@@ -3852,7 +3840,7 @@
72+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
73+ since some C++ compilers masquerading as C compilers
74+ incorrectly reject 9223372036854775807. */
75+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
76++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
77+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
78+ && LARGE_OFF_T % 2147483647 == 1)
79+ ? 1 : -1];
80+@@ -3897,7 +3885,7 @@
81+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
82+ since some C++ compilers masquerading as C compilers
83+ incorrectly reject 9223372036854775807. */
84+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
85++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
86+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
87+ && LARGE_OFF_T % 2147483647 == 1)
88+ ? 1 : -1];
89+@@ -3921,7 +3909,7 @@
90+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
91+ since some C++ compilers masquerading as C compilers
92+ incorrectly reject 9223372036854775807. */
93+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
94++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
95+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
96+ && LARGE_OFF_T % 2147483647 == 1)
97+ ? 1 : -1];
98+diff -ur hackage-package-unix-2.7.2.2/unix.cabal ghc-package-unix-2.7.2.2/unix.cabal
99+--- hackage-package-unix-2.7.2.2/unix.cabal 2017-07-20 06:04:36.000000000 +0800
100++++ ghc-package-unix-2.7.2.2/unix.cabal 2001-09-09 09:46:40.000000000 +0800
101+@@ -62,7 +62,7 @@
102+ buildable: False
103+
104+ build-depends:
105+- base >= 4.5 && < 4.11,
106++ base >= 4.5 && < 4.12,
107+ bytestring >= 0.9.2 && < 0.11,
108+ time >= 1.2 && < 1.9
109+
patches/ghc842/vector-0.11.0.0.patchnew file+508
@@ -0,0 +1,508 @@
1+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs
2+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
3++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -101,12 +101,20 @@
5+ scanl, scanl1,
6+ enumFromTo, enumFromThenTo )
7+
8+-import Data.Int ( Int8, Int16, Int32, Int64 )
9+-import Data.Word ( Word8, Word16, Word32, Word, Word64 )
10++import Data.Int ( Int8, Int16, Int32 )
11++import Data.Word ( Word8, Word16, Word32, Word64 )
12++
13++#if !MIN_VERSION_base(4,8,0)
14++import Data.Word ( Word )
15++#endif
16+
17+ #include "vector.h"
18+ #include "MachDeps.h"
19+
20++#if WORD_SIZE_IN_BITS > 32
21++import Data.Int ( Int64 )
22++#endif
23++
24+ data Chunk v a = Chunk Int (forall m. (PrimMonad m, Vector v a) => Mutable v (PrimState m) a -> m ())
25+
26+ -- | Monadic streams
27+@@ -888,6 +896,7 @@
28+ :: Monad m => Integer -> Integer -> Bundle m v Integer #-}
29+
30+
31++#if WORD_SIZE_IN_BITS > 32
32+
33+ -- FIXME: the "too large" test is totally wrong
34+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Bundle m v a
35+@@ -906,7 +915,6 @@
36+ step z | z <= y = return $ Yield z (z+1)
37+ | otherwise = return $ Done
38+
39+-#if WORD_SIZE_IN_BITS > 32
40+
41+ {-# RULES
42+
43+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs
44+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2015-07-13 12:26:16.000000000 +0800
45++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2001-09-09 09:46:40.000000000 +0800
46+@@ -111,7 +111,7 @@
47+ type MBundle = M.Bundle
48+
49+ inplace :: (forall m. Monad m => S.Stream m a -> S.Stream m b)
50+- -> (Size -> Size) -> Bundle v a -> Bundle v b
51++ -> (Size -> Size) -> Bundle v a -> Bundle v b
52+ {-# INLINE_FUSED inplace #-}
53+ inplace f g b = b `seq` M.fromStream (f (M.elements b)) (g (M.size b))
54+
55+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs
56+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
57++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
58+@@ -89,8 +89,12 @@
59+ scanl, scanl1,
60+ enumFromTo, enumFromThenTo )
61+
62+-import Data.Int ( Int8, Int16, Int32, Int64 )
63++import Data.Int ( Int8, Int16, Int32 )
64++import Data.Word ( Word8, Word16, Word32, Word64 )
65++
66++#if !MIN_VERSION_base(4,8,0)
67+ import Data.Word ( Word8, Word16, Word32, Word, Word64 )
68++#endif
69+
70+ #if __GLASGOW_HASKELL__ >= 708
71+ import GHC.Types ( SPEC(..) )
72+@@ -101,6 +105,10 @@
73+ #include "vector.h"
74+ #include "MachDeps.h"
75+
76++#if WORD_SIZE_IN_BITS > 32
77++import Data.Int ( Int64 )
78++#endif
79++
80+ #if __GLASGOW_HASKELL__ < 708
81+ data SPEC = SPEC | SPEC2
82+ #if __GLASGOW_HASKELL__ >= 700
83+@@ -1403,6 +1411,8 @@
84+
85+
86+
87++#if WORD_SIZE_IN_BITS > 32
88++
89+ -- FIXME: the "too large" test is totally wrong
90+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Stream m a
91+ {-# INLINE_FUSED enumFromTo_big_int #-}
92+@@ -1412,8 +1422,6 @@
93+ step z | z <= y = return $ Yield z (z+1)
94+ | otherwise = return $ Done
95+
96+-#if WORD_SIZE_IN_BITS > 32
97+-
98+ {-# RULES
99+
100+ "enumFromTo<Int64> [Stream]"
101+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs
102+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2015-07-13 12:26:16.000000000 +0800
103++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2001-09-09 09:46:40.000000000 +0800
104+@@ -1,3 +1,4 @@
105++{-# LANGUAGE CPP #-}
106+ -- |
107+ -- Module : Data.Vector.Fusion.Util
108+ -- Copyright : (c) Roman Leshchinskiy 2009
109+@@ -16,7 +17,9 @@
110+ delay_inline, delayed_min
111+ ) where
112+
113++#if !MIN_VERSION_base(4,8,0)
114+ import Control.Applicative (Applicative(..))
115++#endif
116+
117+ -- | Identity monad
118+ newtype Id a = Id { unId :: a }
119+@@ -29,7 +32,7 @@
120+ Id f <*> Id x = Id (f x)
121+
122+ instance Monad Id where
123+- return = Id
124++ return = pure
125+ Id x >>= f = f x
126+
127+ -- | Box monad
128+@@ -43,7 +46,7 @@
129+ Box f <*> Box x = Box (f x)
130+
131+ instance Monad Box where
132+- return = Box
133++ return = pure
134+ Box x >>= f = f x
135+
136+ -- | Delay inlining a function until late in the game (simplifier phase 0).
137+@@ -55,4 +58,3 @@
138+ delayed_min :: Int -> Int -> Int
139+ {-# INLINE [0] delayed_min #-}
140+ delayed_min m n = min m n
141+-
142+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs
143+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
144++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
145+@@ -584,7 +584,7 @@
146+ new n = BOUNDS_CHECK(checkLength) "new" n
147+ $ unsafeNew n >>= \v -> basicInitialize v >> return v
148+
149+--- | Create a mutable vector of the given length. The length is not checked.
150++-- | Create a mutable vector of the given length. The memory is not initialized.
151+ unsafeNew :: (PrimMonad m, MVector v a) => Int -> m (v (PrimState m) a)
152+ {-# INLINE unsafeNew #-}
153+ unsafeNew n = UNSAFE_CHECK(checkLength) "unsafeNew" n
154+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs
155+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs 2015-07-13 12:26:16.000000000 +0800
156++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs 2001-09-09 09:46:40.000000000 +0800
157+@@ -1038,7 +1038,7 @@
158+ imapM_ f = Bundle.mapM_ (uncurry f) . Bundle.indexed . stream
159+
160+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
161+--- vector of results. Equvalent to @flip 'mapM'@.
162++-- vector of results. Equivalent to @flip 'mapM'@.
163+ forM :: (Monad m, Vector v a, Vector v b) => v a -> (a -> m b) -> m (v b)
164+ {-# INLINE forM #-}
165+ forM as f = mapM f as
166+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs
167+--- hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
168++++ ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
169+@@ -268,7 +268,7 @@
170+ {-# INLINE new #-}
171+ new = G.new
172+
173+--- | Create a mutable vector of the given length. The length is not checked.
174++-- | Create a mutable vector of the given length. The memory is not initialized.
175+ unsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) a)
176+ {-# INLINE unsafeNew #-}
177+ unsafeNew = G.unsafeNew
178+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs
179+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
180++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
181+@@ -211,7 +211,7 @@
182+ {-# INLINE new #-}
183+ new = G.new
184+
185+--- | Create a mutable vector of the given length. The length is not checked.
186++-- | Create a mutable vector of the given length. The memory is not initialized.
187+ unsafeNew :: (PrimMonad m, Prim a) => Int -> m (MVector (PrimState m) a)
188+ {-# INLINE unsafeNew #-}
189+ unsafeNew = G.unsafeNew
190+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs
191+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2015-07-13 12:26:16.000000000 +0800
192++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2001-09-09 09:46:40.000000000 +0800
193+@@ -164,7 +164,9 @@
194+ import Data.Data ( Data(..) )
195+ import Text.Read ( Read(..), readListPrecDefault )
196+
197++#if !MIN_VERSION_base(4,8,0)
198+ import Data.Monoid ( Monoid(..) )
199++#endif
200+
201+ #if __GLASGOW_HASKELL__ >= 708
202+ import qualified GHC.Exts as Exts
203+@@ -773,7 +775,7 @@
204+ mapM_ = G.mapM_
205+
206+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
207+--- vector of results. Equvalent to @flip 'mapM'@.
208++-- vector of results. Equivalent to @flip 'mapM'@.
209+ forM :: (Monad m, Prim a, Prim b) => Vector a -> (a -> m b) -> m (Vector b)
210+ {-# INLINE forM #-}
211+ forM = G.forM
212+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs
213+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
214++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
215+@@ -1,4 +1,4 @@
216+-{-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, ScopedTypeVariables #-}
217++{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, MagicHash, MultiParamTypeClasses, ScopedTypeVariables #-}
218+
219+ -- |
220+ -- Module : Data.Vector.Storable.Mutable
221+@@ -65,8 +65,13 @@
222+ import Foreign.Storable
223+ import Foreign.ForeignPtr
224+
225+-#if __GLASGOW_HASKELL__ >= 605
226+-import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
227++#if __GLASGOW_HASKELL__ >= 706
228++import GHC.ForeignPtr (mallocPlainForeignPtrAlignedBytes)
229++#elif __GLASGOW_HASKELL__ >= 700
230++import Data.Primitive.ByteArray (MutableByteArray(..), newAlignedPinnedByteArray,
231++ unsafeFreezeByteArray)
232++import GHC.Prim (byteArrayContents#, unsafeCoerce#)
233++import GHC.ForeignPtr
234+ #endif
235+
236+ import Foreign.Ptr
237+@@ -201,11 +206,26 @@
238+ {-# INLINE mallocVector #-}
239+ mallocVector :: Storable a => Int -> IO (ForeignPtr a)
240+ mallocVector =
241+-#if __GLASGOW_HASKELL__ >= 605
242+- doMalloc undefined
243+- where
244+- doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
245+- doMalloc dummy size = mallocPlainForeignPtrBytes (size * sizeOf dummy)
246++#if __GLASGOW_HASKELL__ >= 706
247++ doMalloc undefined
248++ where
249++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
250++ doMalloc dummy size =
251++ mallocPlainForeignPtrAlignedBytes (size * sizeOf dummy) (alignment dummy)
252++#elif __GLASGOW_HASKELL__ >= 700
253++ doMalloc undefined
254++ where
255++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
256++ doMalloc dummy size = do
257++ arr@(MutableByteArray arr#) <- newAlignedPinnedByteArray arrSize arrAlign
258++ newConcForeignPtr
259++ (Ptr (byteArrayContents# (unsafeCoerce# arr#)))
260++ -- Keep reference to mutable byte array until whole ForeignPtr goes out
261++ -- of scope.
262++ (touch arr)
263++ where
264++ arrSize = size * sizeOf dummy
265++ arrAlign = alignment dummy
266+ #else
267+ mallocForeignPtrArray
268+ #endif
269+@@ -293,7 +313,7 @@
270+ {-# INLINE new #-}
271+ new = G.new
272+
273+--- | Create a mutable vector of the given length. The length is not checked.
274++-- | Create a mutable vector of the given length. The memory is not initialized.
275+ unsafeNew :: (PrimMonad m, Storable a) => Int -> m (MVector (PrimState m) a)
276+ {-# INLINE unsafeNew #-}
277+ unsafeNew = G.unsafeNew
278+@@ -322,14 +342,14 @@
279+ -- | Grow a vector by the given number of elements. The number must be
280+ -- positive.
281+ grow :: (PrimMonad m, Storable a)
282+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
283++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
284+ {-# INLINE grow #-}
285+ grow = G.grow
286+
287+ -- | Grow a vector by the given number of elements. The number must be
288+ -- positive but this is not checked.
289+ unsafeGrow :: (PrimMonad m, Storable a)
290+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
291++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
292+ {-# INLINE unsafeGrow #-}
293+ unsafeGrow = G.unsafeGrow
294+
295+@@ -401,7 +421,7 @@
296+ -- | Copy a vector. The two vectors must have the same length and may not
297+ -- overlap.
298+ copy :: (PrimMonad m, Storable a)
299+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
300++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
301+ {-# INLINE copy #-}
302+ copy = G.copy
303+
304+@@ -422,7 +442,7 @@
305+ -- copied to a temporary vector and then the temporary vector was copied
306+ -- to the target vector.
307+ move :: (PrimMonad m, Storable a)
308+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
309++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
310+ {-# INLINE move #-}
311+ move = G.move
312+
313+@@ -434,9 +454,9 @@
314+ -- copied to a temporary vector and then the temporary vector was copied
315+ -- to the target vector.
316+ unsafeMove :: (PrimMonad m, Storable a)
317+- => MVector (PrimState m) a -- ^ target
318+- -> MVector (PrimState m) a -- ^ source
319+- -> m ()
320++ => MVector (PrimState m) a -- ^ target
321++ -> MVector (PrimState m) a -- ^ source
322++ -> m ()
323+ {-# INLINE unsafeMove #-}
324+ unsafeMove = G.unsafeMove
325+
326+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs
327+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs 2015-07-13 12:26:16.000000000 +0800
328++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs 2001-09-09 09:46:40.000000000 +0800
329+@@ -169,7 +169,9 @@
330+ import Data.Data ( Data(..) )
331+ import Text.Read ( Read(..), readListPrecDefault )
332+
333++#if !MIN_VERSION_base(4,8,0)
334+ import Data.Monoid ( Monoid(..) )
335++#endif
336+
337+ #if __GLASGOW_HASKELL__ >= 708
338+ import qualified GHC.Exts as Exts
339+@@ -783,7 +785,7 @@
340+ mapM_ = G.mapM_
341+
342+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
343+--- vector of results. Equvalent to @flip 'mapM'@.
344++-- vector of results. Equivalent to @flip 'mapM'@.
345+ forM :: (Monad m, Storable a, Storable b) => Vector a -> (a -> m b) -> m (Vector b)
346+ {-# INLINE forM #-}
347+ forM = G.forM
348+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs
349+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2015-07-13 12:26:16.000000000 +0800
350++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2001-09-09 09:46:40.000000000 +0800
351+@@ -30,10 +30,14 @@
352+ import Control.Monad.Primitive
353+ import Control.Monad ( liftM )
354+
355+-import Data.Word ( Word, Word8, Word16, Word32, Word64 )
356++import Data.Word ( Word8, Word16, Word32, Word64 )
357+ import Data.Int ( Int8, Int16, Int32, Int64 )
358+ import Data.Complex
359+
360++#if !MIN_VERSION_base(4,8,0)
361++import Data.Word ( Word )
362++#endif
363++
364+ #if __GLASGOW_HASKELL__ >= 707
365+ import Data.Typeable ( Typeable )
366+ #else
367+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs
368+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
369++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
370+@@ -149,7 +149,7 @@
371+ {-# INLINE new #-}
372+ new = G.new
373+
374+--- | Create a mutable vector of the given length. The length is not checked.
375++-- | Create a mutable vector of the given length. The memory is not initialized.
376+ unsafeNew :: (PrimMonad m, Unbox a) => Int -> m (MVector (PrimState m) a)
377+ {-# INLINE unsafeNew #-}
378+ unsafeNew = G.unsafeNew
379+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs
380+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2015-07-13 12:26:16.000000000 +0800
381++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2001-09-09 09:46:40.000000000 +0800
382+@@ -186,7 +186,9 @@
383+
384+ import Text.Read ( Read(..), readListPrecDefault )
385+
386++#if !MIN_VERSION_base(4,8,0)
387+ import Data.Monoid ( Monoid(..) )
388++#endif
389+
390+ #if __GLASGOW_HASKELL__ >= 708
391+ import qualified GHC.Exts as Exts (IsList(..))
392+@@ -820,7 +822,7 @@
393+ imapM_ = G.imapM_
394+
395+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
396+--- vector of results. Equvalent to @flip 'mapM'@.
397++-- vector of results. Equivalent to @flip 'mapM'@.
398+ forM :: (Monad m, Unbox a, Unbox b) => Vector a -> (a -> m b) -> m (Vector b)
399+ {-# INLINE forM #-}
400+ forM = G.forM
401+diff -ur hackage-package-vector-0.11.0.0/Data/Vector.hs ghc-package-vector-0.11.0.0/Data/Vector.hs
402+--- hackage-package-vector-0.11.0.0/Data/Vector.hs 2015-07-13 12:26:16.000000000 +0800
403++++ ghc-package-vector-0.11.0.0/Data/Vector.hs 2001-09-09 09:46:40.000000000 +0800
404+@@ -150,7 +150,7 @@
405+ -- * Conversions
406+
407+ -- ** Lists
408+- toList, fromList, fromListN,
409++ toList, Data.Vector.fromList, Data.Vector.fromListN,
410+
411+ -- ** Other vector types
412+ G.convert,
413+@@ -187,11 +187,14 @@
414+ import Data.Data ( Data(..) )
415+ import Text.Read ( Read(..), readListPrecDefault )
416+
417+-import Data.Monoid ( Monoid(..) )
418+ import qualified Control.Applicative as Applicative
419+ import qualified Data.Foldable as Foldable
420+ import qualified Data.Traversable as Traversable
421+
422++#if !MIN_VERSION_base(4,8,0)
423++import Data.Monoid ( Monoid(..) )
424++#endif
425++
426+ #if __GLASGOW_HASKELL__ >= 708
427+ import qualified GHC.Exts as Exts (IsList(..))
428+ #endif
429+@@ -220,8 +223,8 @@
430+
431+ instance Exts.IsList (Vector a) where
432+ type Item (Vector a) = a
433+- fromList = fromList
434+- fromListN = fromListN
435++ fromList = Data.Vector.fromList
436++ fromListN = Data.Vector.fromListN
437+ toList = toList
438+ #endif
439+
440+@@ -297,7 +300,7 @@
441+
442+ instance Monad Vector where
443+ {-# INLINE return #-}
444+- return = singleton
445++ return = Applicative.pure
446+
447+ {-# INLINE (>>=) #-}
448+ (>>=) = flip concatMap
449+@@ -341,7 +344,7 @@
450+
451+ instance Traversable.Traversable Vector where
452+ {-# INLINE traverse #-}
453+- traverse f xs = fromList Applicative.<$> Traversable.traverse f (toList xs)
454++ traverse f xs = Data.Vector.fromList Applicative.<$> Traversable.traverse f (toList xs)
455+
456+ {-# INLINE mapM #-}
457+ mapM = mapM
458+@@ -917,7 +920,7 @@
459+ imapM_ = G.imapM_
460+
461+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
462+--- vector of results. Equvalent to @flip 'mapM'@.
463++-- vector of results. Equivalent to @flip 'mapM'@.
464+ forM :: Monad m => Vector a -> (a -> m b) -> m (Vector b)
465+ {-# INLINE forM #-}
466+ forM = G.forM
467+diff -ur hackage-package-vector-0.11.0.0/include/vector.h ghc-package-vector-0.11.0.0/include/vector.h
468+--- hackage-package-vector-0.11.0.0/include/vector.h 2015-07-13 12:26:16.000000000 +0800
469++++ ghc-package-vector-0.11.0.0/include/vector.h 2001-09-09 09:46:40.000000000 +0800
470+@@ -18,4 +18,3 @@
471+
472+ #define PHASE_STREAM Please use "PHASE_FUSED" instead
473+ #define INLINE_STREAM Please use "INLINE_FUSED" instead
474+-
475+diff -ur hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs
476+--- hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs 2015-07-13 12:26:16.000000000 +0800
477++++ ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs 2001-09-09 09:46:40.000000000 +0800
478+@@ -643,6 +643,7 @@
479+ testGroup "Data.Vector.Storable.Vector (Double)" (testNumericStorableVector (undefined :: Data.Vector.Storable.Vector Double)),
480+
481+ testGroup "Data.Vector.Unboxed.Vector ()" (testUnitUnboxedVector (undefined :: Data.Vector.Unboxed.Vector ())),
482++ testGroup "Data.Vector.Unboxed.Vector (Bool)" (testBoolUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Bool)),
483+ testGroup "Data.Vector.Unboxed.Vector (Int)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Int)),
484+ testGroup "Data.Vector.Unboxed.Vector (Double)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Double)),
485+ testGroup "Data.Vector.Unboxed.Vector (Int,Bool)" (testTupleUnboxedVector (undefined :: Data.Vector.Unboxed.Vector (Int,Bool))),
486+diff -ur hackage-package-vector-0.11.0.0/vector.cabal ghc-package-vector-0.11.0.0/vector.cabal
487+--- hackage-package-vector-0.11.0.0/vector.cabal 2015-07-13 12:26:16.000000000 +0800
488++++ ghc-package-vector-0.11.0.0/vector.cabal 2001-09-09 09:46:40.000000000 +0800
489+@@ -38,6 +38,7 @@
490+ Build-Type: Simple
491+
492+ Extra-Source-Files:
493++ changelog
494+ README.md
495+ tests/LICENSE
496+ tests/Setup.hs
497+@@ -137,9 +138,9 @@
498+ Install-Includes:
499+ vector.h
500+
501+- Build-Depends: base >= 4.3 && < 4.9
502++ Build-Depends: base >= 4.3 && < 4.10
503+ , primitive >= 0.5.0.1 && < 0.7
504+- , ghc-prim >= 0.2 && < 0.5
505++ , ghc-prim >= 0.2 && < 0.6
506+ , deepseq >= 1.1 && < 1.5
507+
508+ Ghc-Options: -O2 -Wall -fno-warn-orphans
patches/ghc843/array-0.5.2.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-array-0.5.2.0/array.cabal ghc-package-array-0.5.2.0/array.cabal
2+--- hackage-package-array-0.5.2.0/array.cabal 2017-07-04 06:06:07.000000000 +0800
3++++ ghc-package-array-0.5.2.0/array.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -37,7 +37,7 @@
5+ Trustworthy,
6+ UnboxedTuples,
7+ UnliftedFFITypes
8+- build-depends: base >= 4.7 && < 4.11
9++ build-depends: base >= 4.7 && < 4.12
10+ ghc-options: -Wall
11+ exposed-modules:
12+ Data.Array
patches/ghc843/deepseq-1.4.3.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-deepseq-1.4.3.0/deepseq.cabal ghc-package-deepseq-1.4.3.0/deepseq.cabal
2+--- hackage-package-deepseq-1.4.3.0/deepseq.cabal 2017-07-20 06:00:58.000000000 +0800
3++++ ghc-package-deepseq-1.4.3.0/deepseq.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -61,7 +61,7 @@
5+ if impl(ghc>=7.8)
6+ other-extensions: EmptyCase
7+
8+- build-depends: base >= 4.5 && < 4.11,
9++ build-depends: base >= 4.5 && < 4.12,
10+ array >= 0.4 && < 0.6
11+ ghc-options: -Wall
12+
patches/ghc843/default.nixnew file+12
@@ -0,0 +1,12 @@
1+{
2+ packages.array.patches = [ ./array-0.5.2.0.patch ];
3+ packages.deepseq.patches = [ ./deepseq-1.4.3.0.patch ];
4+ packages.default.nix.patches = [ ./default.nix ];
5+ packages.hpc.patches = [ ./hpc-0.6.0.3.patch ];
6+ packages.parallel.patches = [ ./parallel-3.2.1.1.patch ];
7+ packages.parsec.patches = [ ./parsec-3.1.13.0.patch ];
8+ packages.random.patches = [ ./random-1.1.patch ];
9+ packages.time.patches = [ ./time-1.8.0.2.patch ];
10+ packages.unix.patches = [ ./unix-2.7.2.2.patch ];
11+ packages.vector.patches = [ ./vector-0.11.0.0.patch ];
12+}
patches/ghc843/hpc-0.6.0.3.patchnew file+16
@@ -0,0 +1,16 @@
1+diff -ur hackage-package-hpc-0.6.0.3/hpc.cabal ghc-package-hpc-0.6.0.3/hpc.cabal
2+--- hackage-package-hpc-0.6.0.3/hpc.cabal 2016-05-04 18:47:19.000000000 +0800
3++++ ghc-package-hpc-0.6.0.3/hpc.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -35,9 +35,9 @@
5+ Trace.Hpc.Reflect
6+
7+ Build-Depends:
8+- base >= 4.4.1 && < 4.10,
9++ base >= 4.4.1 && < 4.12,
10+ containers >= 0.4.1 && < 0.6,
11+- directory >= 1.1 && < 1.3,
12++ directory >= 1.1 && < 1.4,
13+ filepath >= 1 && < 1.5,
14+- time >= 1.2 && < 1.7
15++ time >= 1.2 && < 1.9
16+ ghc-options: -Wall
patches/ghc843/parallel-3.2.1.1.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-parallel-3.2.1.1/parallel.cabal ghc-package-parallel-3.2.1.1/parallel.cabal
2+--- hackage-package-parallel-3.2.1.1/parallel.cabal 2017-04-09 00:25:01.000000000 +0800
3++++ ghc-package-parallel-3.2.1.1/parallel.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -34,7 +34,7 @@
5+
6+ build-depends:
7+ array >= 0.3 && < 0.6,
8+- base >= 4.3 && < 4.11,
9++ base >= 4.3 && < 4.12,
10+ containers >= 0.4 && < 0.6,
11+ deepseq >= 1.1 && < 1.5
12+
patches/ghc843/parsec-3.1.13.0.patchnew file+23
@@ -0,0 +1,23 @@
1+diff -ur hackage-package-parsec-3.1.13.0/parsec.cabal ghc-package-parsec-3.1.13.0/parsec.cabal
2+--- hackage-package-parsec-3.1.13.0/parsec.cabal 2018-02-06 17:13:02.000000000 +0800
3++++ ghc-package-parsec-3.1.13.0/parsec.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -21,8 +21,8 @@
5+ license-file: LICENSE
6+ author: Daan Leijen <daan@microsoft.com>, Paolo Martini <paolo@nemail.it>, Antoine Latter <aslatter@gmail.com>
7+ maintainer: Herbert Valerio Riedel <hvr@gnu.org>
8+-homepage: https://github.com/hvr/parsec
9+-bug-reports: https://github.com/hvr/parsec/issues
10++homepage: https://github.com/haskell/parsec
11++bug-reports: https://github.com/haskell/parsec/issues
12+ category: Parsing
13+
14+ build-type: Simple
15+@@ -32,7 +32,7 @@
16+
17+ source-repository head
18+ type: git
19+- location: https://github.com/hvr/parsec
20++ location: https://github.com/haskell/parsec
21+
22+ library
23+ hs-source-dirs: src
patches/ghc843/random-1.1.patchnew file+406
@@ -0,0 +1,406 @@
1+diff -ur hackage-package-random-1.1/README.md ghc-package-random-1.1/README.md
2+--- hackage-package-random-1.1/README.md 2014-09-17 05:34:43.000000000 +0800
3++++ ghc-package-random-1.1/README.md 2001-09-09 09:46:40.000000000 +0800
4+@@ -10,7 +10,7 @@
5+
6+ A module supplying this interface is required for Haskell 98 (but not Haskell
7+ 2010). An older [version]
8+-(http://www.haskell.org/ghc/docs/latest/html/libraries/haskell98/Random.html)
9++(https://downloads.haskell.org/~ghc/latest/docs/html/libraries/haskell98-2.0.0.3/Random.html)
10+ of this library is included with GHC in the haskell98 package. This newer
11+ version, with compatible api, is included in the [Haskell Platform]
12+ (http://www.haskell.org/platform/contents.html).
13+diff -ur hackage-package-random-1.1/System/Random.hs ghc-package-random-1.1/System/Random.hs
14+--- hackage-package-random-1.1/System/Random.hs 2014-09-17 05:34:43.000000000 +0800
15++++ ghc-package-random-1.1/System/Random.hs 2001-09-09 09:46:40.000000000 +0800
16+@@ -7,7 +7,7 @@
17+ -- Module : System.Random
18+ -- Copyright : (c) The University of Glasgow 2001
19+ -- License : BSD-style (see the file LICENSE in the 'random' repository)
20+---
21++--
22+ -- Maintainer : libraries@haskell.org
23+ -- Stability : stable
24+ -- Portability : portable
25+@@ -18,7 +18,7 @@
26+ -- or to get different results on each run by using the system-initialised
27+ -- generator or by supplying a seed from some other source.
28+ --
29+--- The library is split into two layers:
30++-- The library is split into two layers:
31+ --
32+ -- * A core /random number generator/ provides a supply of bits.
33+ -- The class 'RandomGen' provides a common interface to such generators.
34+@@ -40,40 +40,40 @@
35+ #include "MachDeps.h"
36+
37+ module System.Random
38+- (
39++ (
40+
41+- -- $intro
42++ -- $intro
43+
44+- -- * Random number generators
45++ -- * Random number generators
46+
47+ #ifdef ENABLE_SPLITTABLEGEN
48+- RandomGen(next, genRange)
49+- , SplittableGen(split)
50++ RandomGen(next, genRange)
51++ , SplittableGen(split)
52+ #else
53+- RandomGen(next, genRange, split)
54++ RandomGen(next, genRange, split)
55+ #endif
56+- -- ** Standard random number generators
57+- , StdGen
58+- , mkStdGen
59++ -- ** Standard random number generators
60++ , StdGen
61++ , mkStdGen
62+
63+- -- ** The global random number generator
64++ -- ** The global random number generator
65+
66+- -- $globalrng
67++ -- $globalrng
68+
69+- , getStdRandom
70+- , getStdGen
71+- , setStdGen
72+- , newStdGen
73++ , getStdRandom
74++ , getStdGen
75++ , setStdGen
76++ , newStdGen
77+
78+- -- * Random values of various types
79+- , Random ( random, randomR,
80+- randoms, randomRs,
81+- randomIO, randomRIO )
82++ -- * Random values of various types
83++ , Random ( random, randomR,
84++ randoms, randomRs,
85++ randomIO, randomRIO )
86+
87+- -- * References
88+- -- $references
89++ -- * References
90++ -- $references
91+
92+- ) where
93++ ) where
94+
95+ import Prelude
96+
97+@@ -83,15 +83,15 @@
98+ import Foreign.C.Types
99+
100+ #ifdef __NHC__
101+-import CPUTime ( getCPUTime )
102++import CPUTime ( getCPUTime )
103+ import Foreign.Ptr ( Ptr, nullPtr )
104+-import Foreign.C ( CTime, CUInt )
105++import Foreign.C ( CTime, CUInt )
106+ #else
107+-import System.CPUTime ( getCPUTime )
108+-import Data.Time ( getCurrentTime, UTCTime(..) )
109++import System.CPUTime ( getCPUTime )
110++import Data.Time ( getCurrentTime, UTCTime(..) )
111+ import Data.Ratio ( numerator, denominator )
112+ #endif
113+-import Data.Char ( isSpace, chr, ord )
114++import Data.Char ( isSpace, chr, ord )
115+ import System.IO.Unsafe ( unsafePerformIO )
116+ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
117+ #if MIN_VERSION_base (4,6,0)
118+@@ -99,7 +99,7 @@
119+ #else
120+ import Data.IORef ( atomicModifyIORef )
121+ #endif
122+-import Numeric ( readDec )
123++import Numeric ( readDec )
124+
125+ #ifdef __GLASGOW_HASKELL__
126+ import GHC.Exts ( build )
127+@@ -201,17 +201,17 @@
128+
129+ In addition, 'reads' may be used to map an arbitrary string (not necessarily one
130+ produced by 'show') onto a value of type 'StdGen'. In general, the 'Read'
131+-instance of 'StdGen' has the following properties:
132++instance of 'StdGen' has the following properties:
133+
134+-* It guarantees to succeed on any string.
135++* It guarantees to succeed on any string.
136+
137+-* It guarantees to consume only a finite portion of the string.
138++* It guarantees to consume only a finite portion of the string.
139+
140+ * Different argument strings are likely to result in different results.
141+
142+ -}
143+
144+-data StdGen
145++data StdGen
146+ = StdGen !Int32 !Int32
147+
148+ instance RandomGen StdGen where
149+@@ -224,8 +224,8 @@
150+ split = stdSplit
151+
152+ instance Show StdGen where
153+- showsPrec p (StdGen s1 s2) =
154+- showsPrec p s1 .
155++ showsPrec p (StdGen s1 s2) =
156++ showsPrec p s1 .
157+ showChar ' ' .
158+ showsPrec p s2
159+
160+@@ -234,11 +234,11 @@
161+ case try_read r of
162+ r'@[_] -> r'
163+ _ -> [stdFromString r] -- because it shouldn't ever fail.
164+- where
165++ where
166+ try_read r = do
167+ (s1, r1) <- readDec (dropWhile isSpace r)
168+- (s2, r2) <- readDec (dropWhile isSpace r1)
169+- return (StdGen s1 s2, r2)
170++ (s2, r2) <- readDec (dropWhile isSpace r1)
171++ return (StdGen s1 s2, r2)
172+
173+ {-
174+ If we cannot unravel the StdGen from a string, create
175+@@ -246,7 +246,7 @@
176+ -}
177+ stdFromString :: String -> (StdGen, String)
178+ stdFromString s = (mkStdGen num, rest)
179+- where (cs, rest) = splitAt 6 s
180++ where (cs, rest) = splitAt 6 s
181+ num = foldl (\a x -> x + 3 * a) 1 (map ord cs)
182+
183+
184+@@ -266,11 +266,11 @@
185+ mkStdGen32 :: Int32 -> StdGen
186+ mkStdGen32 sMaybeNegative = StdGen (s1+1) (s2+1)
187+ where
188+- -- We want a non-negative number, but we can't just take the abs
189+- -- of sMaybeNegative as -minBound == minBound.
190+- s = sMaybeNegative .&. maxBound
191+- (q, s1) = s `divMod` 2147483562
192+- s2 = q `mod` 2147483398
193++ -- We want a non-negative number, but we can't just take the abs
194++ -- of sMaybeNegative as -minBound == minBound.
195++ s = sMaybeNegative .&. maxBound
196++ (q, s1) = s `divMod` 2147483562
197++ s2 = q `mod` 2147483398
198+
199+ createStdGen :: Integer -> StdGen
200+ createStdGen s = mkStdGen32 $ fromIntegral s
201+@@ -323,7 +323,7 @@
202+ -- | A variant of 'random' that uses the global random number generator
203+ -- (see "System.Random#globalrng").
204+ randomIO :: IO a
205+- randomIO = getStdRandom random
206++ randomIO = getStdRandom random
207+
208+ -- | Produce an infinite list-equivalent of random values.
209+ {-# INLINE buildRandoms #-}
210+@@ -340,7 +340,7 @@
211+
212+ instance Random Integer where
213+ randomR ival g = randomIvalInteger ival g
214+- random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
215++ random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
216+
217+ instance Random Int where randomR = randomIvalIntegral; random = randomBounded
218+ instance Random Int8 where randomR = randomIvalIntegral; random = randomBounded
219+@@ -378,13 +378,13 @@
220+ instance Random CUIntMax where randomR = randomIvalIntegral; random = randomBounded
221+
222+ instance Random Char where
223+- randomR (a,b) g =
224++ randomR (a,b) g =
225+ case (randomIvalInteger (toInteger (ord a), toInteger (ord b)) g) of
226+ (x,g') -> (chr x, g')
227+- random g = randomR (minBound,maxBound) g
228++ random g = randomR (minBound,maxBound) g
229+
230+ instance Random Bool where
231+- randomR (a,b) g =
232++ randomR (a,b) g =
233+ case (randomIvalInteger (bool2Int a, bool2Int b) g) of
234+ (x, g') -> (int2Bool x, g')
235+ where
236+@@ -392,42 +392,42 @@
237+ bool2Int False = 0
238+ bool2Int True = 1
239+
240+- int2Bool :: Int -> Bool
241+- int2Bool 0 = False
242+- int2Bool _ = True
243++ int2Bool :: Int -> Bool
244++ int2Bool 0 = False
245++ int2Bool _ = True
246+
247+- random g = randomR (minBound,maxBound) g
248++ random g = randomR (minBound,maxBound) g
249+
250+ {-# INLINE randomRFloating #-}
251+ randomRFloating :: (Fractional a, Num a, Ord a, Random a, RandomGen g) => (a, a) -> g -> (a, g)
252+-randomRFloating (l,h) g
253++randomRFloating (l,h) g
254+ | l>h = randomRFloating (h,l) g
255+- | otherwise = let (coef,g') = random g in
256+- (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
257++ | otherwise = let (coef,g') = random g in
258++ (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
259+
260+ instance Random Double where
261+ randomR = randomRFloating
262+- random rng =
263+- case random rng of
264+- (x,rng') ->
265++ random rng =
266++ case random rng of
267++ (x,rng') ->
268+ -- We use 53 bits of randomness corresponding to the 53 bit significand:
269+- ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
270+- / fromIntegral twoto53, rng')
271+- where
272++ ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
273++ / fromIntegral twoto53, rng')
274++ where
275+ twoto53 = (2::Int64) ^ (53::Int64)
276+ mask53 = twoto53 - 1
277+-
278++
279+ instance Random Float where
280+ randomR = randomRFloating
281+- random rng =
282+- -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
283+- case random rng of
284+- (x,rng') ->
285++ random rng =
286++ -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
287++ case random rng of
288++ (x,rng') ->
289+ -- We use 24 bits of randomness corresponding to the 24 bit significand:
290+- ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
291+- / fromIntegral twoto24, rng')
292+- -- Note, encodeFloat is another option, but I'm not seeing slightly
293+- -- worse performance with the following [2011.06.25]:
294++ ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
295++ / fromIntegral twoto24, rng')
296++ -- Note, encodeFloat is another option, but I'm not seeing slightly
297++ -- worse performance with the following [2011.06.25]:
298+ -- (encodeFloat rand (-24), rng')
299+ where
300+ mask24 = twoto24 - 1
301+@@ -436,8 +436,8 @@
302+ -- CFloat/CDouble are basically the same as a Float/Double:
303+ instance Random CFloat where
304+ randomR = randomRFloating
305+- random rng = case random rng of
306+- (x,rng') -> (realToFrac (x::Float), rng')
307++ random rng = case random rng of
308++ (x,rng') -> (realToFrac (x::Float), rng')
309+
310+ instance Random CDouble where
311+ randomR = randomRFloating
312+@@ -445,8 +445,8 @@
313+ -- Presently, this is showing better performance than the Double instance:
314+ -- (And yet, if the Double instance uses randomFrac then its performance is much worse!)
315+ random = randomFrac
316+- -- random rng = case random rng of
317+- -- (x,rng') -> (realToFrac (x::Double), rng')
318++ -- random rng = case random rng of
319++ -- (x,rng') -> (realToFrac (x::Double), rng')
320+
321+ mkStdRNG :: Integer -> IO StdGen
322+ mkStdRNG o = do
323+@@ -463,7 +463,7 @@
324+
325+ {-# SPECIALIZE randomIvalInteger :: (Num a) =>
326+ (Integer, Integer) -> StdGen -> (a, StdGen) #-}
327+-
328++
329+ randomIvalInteger :: (RandomGen g, Num a) => (Integer, Integer) -> g -> (a, g)
330+ randomIvalInteger (l,h) rng
331+ | l > h = randomIvalInteger (h,l) rng
332+@@ -482,7 +482,7 @@
333+ k = h - l + 1
334+ magtgt = k * q
335+
336+- -- generate random values until we exceed the target magnitude
337++ -- generate random values until we exceed the target magnitude
338+ f mag v g | mag >= magtgt = (v, g)
339+ | otherwise = v' `seq`f (mag*b) v' g' where
340+ (x,g') = next g
341+@@ -494,18 +494,18 @@
342+ randomFrac = randomIvalDouble (0::Double,1) realToFrac
343+
344+ randomIvalDouble :: (RandomGen g, Fractional a) => (Double, Double) -> (Double -> a) -> g -> (a, g)
345+-randomIvalDouble (l,h) fromDouble rng
346++randomIvalDouble (l,h) fromDouble rng
347+ | l > h = randomIvalDouble (h,l) fromDouble rng
348+- | otherwise =
349++ | otherwise =
350+ case (randomIvalInteger (toInteger (minBound::Int32), toInteger (maxBound::Int32)) rng) of
351+- (x, rng') ->
352+- let
353+- scaled_x =
354+- fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
355++ (x, rng') ->
356++ let
357++ scaled_x =
358++ fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
359+ fromDouble ((0.5*h - 0.5*l) / (0.5 * realToFrac int32Count)) * -- avoid overflow
360+- fromIntegral (x::Int32)
361+- in
362+- (scaled_x, rng')
363++ fromIntegral (x::Int32)
364++ in
365++ (scaled_x, rng')
366+
367+ int32Count :: Integer
368+ int32Count = toInteger (maxBound::Int32) - toInteger (minBound::Int32) + 1 -- GHC ticket #3982
369+@@ -516,16 +516,16 @@
370+ stdNext :: StdGen -> (Int, StdGen)
371+ -- Returns values in the range stdRange
372+ stdNext (StdGen s1 s2) = (fromIntegral z', StdGen s1'' s2'')
373+- where z' = if z < 1 then z + 2147483562 else z
374+- z = s1'' - s2''
375++ where z' = if z < 1 then z + 2147483562 else z
376++ z = s1'' - s2''
377+
378+- k = s1 `quot` 53668
379+- s1' = 40014 * (s1 - k * 53668) - k * 12211
380+- s1'' = if s1' < 0 then s1' + 2147483563 else s1'
381+-
382+- k' = s2 `quot` 52774
383+- s2' = 40692 * (s2 - k' * 52774) - k' * 3791
384+- s2'' = if s2' < 0 then s2' + 2147483399 else s2'
385++ k = s1 `quot` 53668
386++ s1' = 40014 * (s1 - k * 53668) - k * 12211
387++ s1'' = if s1' < 0 then s1' + 2147483563 else s1'
388++
389++ k' = s2 `quot` 52774
390++ s2' = 40692 * (s2 - k' * 52774) - k' * 3791
391++ s2'' = if s2' < 0 then s2' + 2147483399 else s2'
392+
393+ stdSplit :: StdGen -> (StdGen, StdGen)
394+ stdSplit std@(StdGen s1 s2)
395+diff -ur hackage-package-random-1.1/random.cabal ghc-package-random-1.1/random.cabal
396+--- hackage-package-random-1.1/random.cabal 2014-09-17 05:34:43.000000000 +0800
397++++ ghc-package-random-1.1/random.cabal 2001-09-09 09:46:40.000000000 +0800
398+@@ -40,7 +40,7 @@
399+
400+ source-repository head
401+ type: git
402+- location: http://git.haskell.org/packages/random.git
403++ location: https://github.com/haskell/random.git
404+
405+ -- To run the Test-Suite:
406+ -- $ cabal configure --enable-tests
patches/ghc843/time-1.8.0.2.patchnew file+146
@@ -0,0 +1,146 @@
1+diff -ur hackage-package-time-1.8.0.2/configure ghc-package-time-1.8.0.2/configure
2+--- hackage-package-time-1.8.0.2/configure 2016-12-07 03:31:54.000000000 +0800
3++++ ghc-package-time-1.8.0.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,6 +1,6 @@
5+ #! /bin/sh
6+ # Guess values for system-dependent variables and create Makefiles.
7+-# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.
8++# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.0.2.
9+ #
10+ # Report bugs to <ashley@semantic.org>.
11+ #
12+@@ -580,8 +580,8 @@
13+ # Identity of this package.
14+ PACKAGE_NAME='Haskell time package'
15+ PACKAGE_TARNAME='time'
16+-PACKAGE_VERSION='1.8'
17+-PACKAGE_STRING='Haskell time package 1.8'
18++PACKAGE_VERSION='1.8.0.2'
19++PACKAGE_STRING='Haskell time package 1.8.0.2'
20+ PACKAGE_BUGREPORT='ashley@semantic.org'
21+ PACKAGE_URL=''
22+
23+@@ -653,7 +653,6 @@
24+ docdir
25+ oldincludedir
26+ includedir
27+-runstatedir
28+ localstatedir
29+ sharedstatedir
30+ sysconfdir
31+@@ -726,7 +725,6 @@
32+ sysconfdir='${prefix}/etc'
33+ sharedstatedir='${prefix}/com'
34+ localstatedir='${prefix}/var'
35+-runstatedir='${localstatedir}/run'
36+ includedir='${prefix}/include'
37+ oldincludedir='/usr/include'
38+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
39+@@ -979,15 +977,6 @@
40+ | -silent | --silent | --silen | --sile | --sil)
41+ silent=yes ;;
42+
43+- -runstatedir | --runstatedir | --runstatedi | --runstated \
44+- | --runstate | --runstat | --runsta | --runst | --runs \
45+- | --run | --ru | --r)
46+- ac_prev=runstatedir ;;
47+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
48+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
49+- | --run=* | --ru=* | --r=*)
50+- runstatedir=$ac_optarg ;;
51+-
52+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
53+ ac_prev=sbindir ;;
54+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
55+@@ -1125,7 +1114,7 @@
56+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
57+ datadir sysconfdir sharedstatedir localstatedir includedir \
58+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
59+- libdir localedir mandir runstatedir
60++ libdir localedir mandir
61+ do
62+ eval ac_val=\$$ac_var
63+ # Remove trailing slashes.
64+@@ -1238,7 +1227,7 @@
65+ # Omit some internal or obsolete options to make the list less imposing.
66+ # This message is too long to be a string in the A/UX 3.1 sh.
67+ cat <<_ACEOF
68+-\`configure' configures Haskell time package 1.8 to adapt to many kinds of systems.
69++\`configure' configures Haskell time package 1.8.0.2 to adapt to many kinds of systems.
70+
71+ Usage: $0 [OPTION]... [VAR=VALUE]...
72+
73+@@ -1278,7 +1267,6 @@
74+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
75+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
76+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
77+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
78+ --libdir=DIR object code libraries [EPREFIX/lib]
79+ --includedir=DIR C header files [PREFIX/include]
80+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
81+@@ -1300,7 +1288,7 @@
82+
83+ if test -n "$ac_init_help"; then
84+ case $ac_init_help in
85+- short | recursive ) echo "Configuration of Haskell time package 1.8:";;
86++ short | recursive ) echo "Configuration of Haskell time package 1.8.0.2:";;
87+ esac
88+ cat <<\_ACEOF
89+
90+@@ -1386,7 +1374,7 @@
91+ test -n "$ac_init_help" && exit $ac_status
92+ if $ac_init_version; then
93+ cat <<\_ACEOF
94+-Haskell time package configure 1.8
95++Haskell time package configure 1.8.0.2
96+ generated by GNU Autoconf 2.69
97+
98+ Copyright (C) 2012 Free Software Foundation, Inc.
99+@@ -1858,7 +1846,7 @@
100+ This file contains any messages produced by compilers while
101+ running configure, to aid debugging if configure makes a mistake.
102+
103+-It was created by Haskell time package $as_me 1.8, which was
104++It was created by Haskell time package $as_me 1.8.0.2, which was
105+ generated by GNU Autoconf 2.69. Invocation command line was
106+
107+ $ $0 $@
108+@@ -4193,7 +4181,7 @@
109+ # report actual input values of CONFIG_FILES etc. instead of their
110+ # values after options handling.
111+ ac_log="
112+-This file was extended by Haskell time package $as_me 1.8, which was
113++This file was extended by Haskell time package $as_me 1.8.0.2, which was
114+ generated by GNU Autoconf 2.69. Invocation command line was
115+
116+ CONFIG_FILES = $CONFIG_FILES
117+@@ -4246,7 +4234,7 @@
118+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
119+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
120+ ac_cs_version="\\
121+-Haskell time package config.status 1.8
122++Haskell time package config.status 1.8.0.2
123+ configured by $0, generated by GNU Autoconf 2.69,
124+ with options \\"\$ac_cs_config\\"
125+
126+diff -ur hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h
127+--- hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2017-05-13 18:29:46.000000000 +0800
128++++ ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2001-09-09 09:46:40.000000000 +0800
129+@@ -69,7 +69,7 @@
130+ #define PACKAGE_NAME "Haskell time package"
131+
132+ /* Define to the full name and version of this package. */
133+-#define PACKAGE_STRING "Haskell time package 1.8"
134++#define PACKAGE_STRING "Haskell time package 1.8.0.2"
135+
136+ /* Define to the one symbol short name of this package. */
137+ #define PACKAGE_TARNAME "time"
138+@@ -78,7 +78,7 @@
139+ #define PACKAGE_URL ""
140+
141+ /* Define to the version of this package. */
142+-#define PACKAGE_VERSION "1.8"
143++#define PACKAGE_VERSION "1.8.0.2"
144+
145+ /* Define to 1 if you have the ANSI C header files. */
146+ #define STDC_HEADERS 1
patches/ghc843/unix-2.7.2.2.patchnew file+109
@@ -0,0 +1,109 @@
1+diff -ur hackage-package-unix-2.7.2.2/configure ghc-package-unix-2.7.2.2/configure
2+--- hackage-package-unix-2.7.2.2/configure 2017-07-20 06:04:36.000000000 +0800
3++++ ghc-package-unix-2.7.2.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -667,7 +667,6 @@
5+ docdir
6+ oldincludedir
7+ includedir
8+-runstatedir
9+ localstatedir
10+ sharedstatedir
11+ sysconfdir
12+@@ -739,7 +738,6 @@
13+ sysconfdir='${prefix}/etc'
14+ sharedstatedir='${prefix}/com'
15+ localstatedir='${prefix}/var'
16+-runstatedir='${localstatedir}/run'
17+ includedir='${prefix}/include'
18+ oldincludedir='/usr/include'
19+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
20+@@ -992,15 +990,6 @@
21+ | -silent | --silent | --silen | --sile | --sil)
22+ silent=yes ;;
23+
24+- -runstatedir | --runstatedir | --runstatedi | --runstated \
25+- | --runstate | --runstat | --runsta | --runst | --runs \
26+- | --run | --ru | --r)
27+- ac_prev=runstatedir ;;
28+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
29+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
30+- | --run=* | --ru=* | --r=*)
31+- runstatedir=$ac_optarg ;;
32+-
33+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
34+ ac_prev=sbindir ;;
35+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
36+@@ -1138,7 +1127,7 @@
37+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
38+ datadir sysconfdir sharedstatedir localstatedir includedir \
39+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
40+- libdir localedir mandir runstatedir
41++ libdir localedir mandir
42+ do
43+ eval ac_val=\$$ac_var
44+ # Remove trailing slashes.
45+@@ -1291,7 +1280,6 @@
46+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
47+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
48+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
49+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
50+ --libdir=DIR object code libraries [EPREFIX/lib]
51+ --includedir=DIR C header files [PREFIX/include]
52+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
53+@@ -3782,7 +3770,7 @@
54+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
55+ since some C++ compilers masquerading as C compilers
56+ incorrectly reject 9223372036854775807. */
57+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
58++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
59+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
60+ && LARGE_OFF_T % 2147483647 == 1)
61+ ? 1 : -1];
62+@@ -3828,7 +3816,7 @@
63+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
64+ since some C++ compilers masquerading as C compilers
65+ incorrectly reject 9223372036854775807. */
66+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
67++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
68+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
69+ && LARGE_OFF_T % 2147483647 == 1)
70+ ? 1 : -1];
71+@@ -3852,7 +3840,7 @@
72+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
73+ since some C++ compilers masquerading as C compilers
74+ incorrectly reject 9223372036854775807. */
75+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
76++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
77+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
78+ && LARGE_OFF_T % 2147483647 == 1)
79+ ? 1 : -1];
80+@@ -3897,7 +3885,7 @@
81+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
82+ since some C++ compilers masquerading as C compilers
83+ incorrectly reject 9223372036854775807. */
84+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
85++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
86+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
87+ && LARGE_OFF_T % 2147483647 == 1)
88+ ? 1 : -1];
89+@@ -3921,7 +3909,7 @@
90+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
91+ since some C++ compilers masquerading as C compilers
92+ incorrectly reject 9223372036854775807. */
93+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
94++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
95+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
96+ && LARGE_OFF_T % 2147483647 == 1)
97+ ? 1 : -1];
98+diff -ur hackage-package-unix-2.7.2.2/unix.cabal ghc-package-unix-2.7.2.2/unix.cabal
99+--- hackage-package-unix-2.7.2.2/unix.cabal 2017-07-20 06:04:36.000000000 +0800
100++++ ghc-package-unix-2.7.2.2/unix.cabal 2001-09-09 09:46:40.000000000 +0800
101+@@ -62,7 +62,7 @@
102+ buildable: False
103+
104+ build-depends:
105+- base >= 4.5 && < 4.11,
106++ base >= 4.5 && < 4.12,
107+ bytestring >= 0.9.2 && < 0.11,
108+ time >= 1.2 && < 1.9
109+
patches/ghc843/vector-0.11.0.0.patchnew file+508
@@ -0,0 +1,508 @@
1+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs
2+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
3++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -101,12 +101,20 @@
5+ scanl, scanl1,
6+ enumFromTo, enumFromThenTo )
7+
8+-import Data.Int ( Int8, Int16, Int32, Int64 )
9+-import Data.Word ( Word8, Word16, Word32, Word, Word64 )
10++import Data.Int ( Int8, Int16, Int32 )
11++import Data.Word ( Word8, Word16, Word32, Word64 )
12++
13++#if !MIN_VERSION_base(4,8,0)
14++import Data.Word ( Word )
15++#endif
16+
17+ #include "vector.h"
18+ #include "MachDeps.h"
19+
20++#if WORD_SIZE_IN_BITS > 32
21++import Data.Int ( Int64 )
22++#endif
23++
24+ data Chunk v a = Chunk Int (forall m. (PrimMonad m, Vector v a) => Mutable v (PrimState m) a -> m ())
25+
26+ -- | Monadic streams
27+@@ -888,6 +896,7 @@
28+ :: Monad m => Integer -> Integer -> Bundle m v Integer #-}
29+
30+
31++#if WORD_SIZE_IN_BITS > 32
32+
33+ -- FIXME: the "too large" test is totally wrong
34+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Bundle m v a
35+@@ -906,7 +915,6 @@
36+ step z | z <= y = return $ Yield z (z+1)
37+ | otherwise = return $ Done
38+
39+-#if WORD_SIZE_IN_BITS > 32
40+
41+ {-# RULES
42+
43+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs
44+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2015-07-13 12:26:16.000000000 +0800
45++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2001-09-09 09:46:40.000000000 +0800
46+@@ -111,7 +111,7 @@
47+ type MBundle = M.Bundle
48+
49+ inplace :: (forall m. Monad m => S.Stream m a -> S.Stream m b)
50+- -> (Size -> Size) -> Bundle v a -> Bundle v b
51++ -> (Size -> Size) -> Bundle v a -> Bundle v b
52+ {-# INLINE_FUSED inplace #-}
53+ inplace f g b = b `seq` M.fromStream (f (M.elements b)) (g (M.size b))
54+
55+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs
56+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
57++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
58+@@ -89,8 +89,12 @@
59+ scanl, scanl1,
60+ enumFromTo, enumFromThenTo )
61+
62+-import Data.Int ( Int8, Int16, Int32, Int64 )
63++import Data.Int ( Int8, Int16, Int32 )
64++import Data.Word ( Word8, Word16, Word32, Word64 )
65++
66++#if !MIN_VERSION_base(4,8,0)
67+ import Data.Word ( Word8, Word16, Word32, Word, Word64 )
68++#endif
69+
70+ #if __GLASGOW_HASKELL__ >= 708
71+ import GHC.Types ( SPEC(..) )
72+@@ -101,6 +105,10 @@
73+ #include "vector.h"
74+ #include "MachDeps.h"
75+
76++#if WORD_SIZE_IN_BITS > 32
77++import Data.Int ( Int64 )
78++#endif
79++
80+ #if __GLASGOW_HASKELL__ < 708
81+ data SPEC = SPEC | SPEC2
82+ #if __GLASGOW_HASKELL__ >= 700
83+@@ -1403,6 +1411,8 @@
84+
85+
86+
87++#if WORD_SIZE_IN_BITS > 32
88++
89+ -- FIXME: the "too large" test is totally wrong
90+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Stream m a
91+ {-# INLINE_FUSED enumFromTo_big_int #-}
92+@@ -1412,8 +1422,6 @@
93+ step z | z <= y = return $ Yield z (z+1)
94+ | otherwise = return $ Done
95+
96+-#if WORD_SIZE_IN_BITS > 32
97+-
98+ {-# RULES
99+
100+ "enumFromTo<Int64> [Stream]"
101+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs
102+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2015-07-13 12:26:16.000000000 +0800
103++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2001-09-09 09:46:40.000000000 +0800
104+@@ -1,3 +1,4 @@
105++{-# LANGUAGE CPP #-}
106+ -- |
107+ -- Module : Data.Vector.Fusion.Util
108+ -- Copyright : (c) Roman Leshchinskiy 2009
109+@@ -16,7 +17,9 @@
110+ delay_inline, delayed_min
111+ ) where
112+
113++#if !MIN_VERSION_base(4,8,0)
114+ import Control.Applicative (Applicative(..))
115++#endif
116+
117+ -- | Identity monad
118+ newtype Id a = Id { unId :: a }
119+@@ -29,7 +32,7 @@
120+ Id f <*> Id x = Id (f x)
121+
122+ instance Monad Id where
123+- return = Id
124++ return = pure
125+ Id x >>= f = f x
126+
127+ -- | Box monad
128+@@ -43,7 +46,7 @@
129+ Box f <*> Box x = Box (f x)
130+
131+ instance Monad Box where
132+- return = Box
133++ return = pure
134+ Box x >>= f = f x
135+
136+ -- | Delay inlining a function until late in the game (simplifier phase 0).
137+@@ -55,4 +58,3 @@
138+ delayed_min :: Int -> Int -> Int
139+ {-# INLINE [0] delayed_min #-}
140+ delayed_min m n = min m n
141+-
142+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs
143+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
144++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
145+@@ -584,7 +584,7 @@
146+ new n = BOUNDS_CHECK(checkLength) "new" n
147+ $ unsafeNew n >>= \v -> basicInitialize v >> return v
148+
149+--- | Create a mutable vector of the given length. The length is not checked.
150++-- | Create a mutable vector of the given length. The memory is not initialized.
151+ unsafeNew :: (PrimMonad m, MVector v a) => Int -> m (v (PrimState m) a)
152+ {-# INLINE unsafeNew #-}
153+ unsafeNew n = UNSAFE_CHECK(checkLength) "unsafeNew" n
154+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs
155+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs 2015-07-13 12:26:16.000000000 +0800
156++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs 2001-09-09 09:46:40.000000000 +0800
157+@@ -1038,7 +1038,7 @@
158+ imapM_ f = Bundle.mapM_ (uncurry f) . Bundle.indexed . stream
159+
160+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
161+--- vector of results. Equvalent to @flip 'mapM'@.
162++-- vector of results. Equivalent to @flip 'mapM'@.
163+ forM :: (Monad m, Vector v a, Vector v b) => v a -> (a -> m b) -> m (v b)
164+ {-# INLINE forM #-}
165+ forM as f = mapM f as
166+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs
167+--- hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
168++++ ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
169+@@ -268,7 +268,7 @@
170+ {-# INLINE new #-}
171+ new = G.new
172+
173+--- | Create a mutable vector of the given length. The length is not checked.
174++-- | Create a mutable vector of the given length. The memory is not initialized.
175+ unsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) a)
176+ {-# INLINE unsafeNew #-}
177+ unsafeNew = G.unsafeNew
178+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs
179+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
180++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
181+@@ -211,7 +211,7 @@
182+ {-# INLINE new #-}
183+ new = G.new
184+
185+--- | Create a mutable vector of the given length. The length is not checked.
186++-- | Create a mutable vector of the given length. The memory is not initialized.
187+ unsafeNew :: (PrimMonad m, Prim a) => Int -> m (MVector (PrimState m) a)
188+ {-# INLINE unsafeNew #-}
189+ unsafeNew = G.unsafeNew
190+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs
191+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2015-07-13 12:26:16.000000000 +0800
192++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2001-09-09 09:46:40.000000000 +0800
193+@@ -164,7 +164,9 @@
194+ import Data.Data ( Data(..) )
195+ import Text.Read ( Read(..), readListPrecDefault )
196+
197++#if !MIN_VERSION_base(4,8,0)
198+ import Data.Monoid ( Monoid(..) )
199++#endif
200+
201+ #if __GLASGOW_HASKELL__ >= 708
202+ import qualified GHC.Exts as Exts
203+@@ -773,7 +775,7 @@
204+ mapM_ = G.mapM_
205+
206+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
207+--- vector of results. Equvalent to @flip 'mapM'@.
208++-- vector of results. Equivalent to @flip 'mapM'@.
209+ forM :: (Monad m, Prim a, Prim b) => Vector a -> (a -> m b) -> m (Vector b)
210+ {-# INLINE forM #-}
211+ forM = G.forM
212+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs
213+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
214++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
215+@@ -1,4 +1,4 @@
216+-{-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, ScopedTypeVariables #-}
217++{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, MagicHash, MultiParamTypeClasses, ScopedTypeVariables #-}
218+
219+ -- |
220+ -- Module : Data.Vector.Storable.Mutable
221+@@ -65,8 +65,13 @@
222+ import Foreign.Storable
223+ import Foreign.ForeignPtr
224+
225+-#if __GLASGOW_HASKELL__ >= 605
226+-import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
227++#if __GLASGOW_HASKELL__ >= 706
228++import GHC.ForeignPtr (mallocPlainForeignPtrAlignedBytes)
229++#elif __GLASGOW_HASKELL__ >= 700
230++import Data.Primitive.ByteArray (MutableByteArray(..), newAlignedPinnedByteArray,
231++ unsafeFreezeByteArray)
232++import GHC.Prim (byteArrayContents#, unsafeCoerce#)
233++import GHC.ForeignPtr
234+ #endif
235+
236+ import Foreign.Ptr
237+@@ -201,11 +206,26 @@
238+ {-# INLINE mallocVector #-}
239+ mallocVector :: Storable a => Int -> IO (ForeignPtr a)
240+ mallocVector =
241+-#if __GLASGOW_HASKELL__ >= 605
242+- doMalloc undefined
243+- where
244+- doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
245+- doMalloc dummy size = mallocPlainForeignPtrBytes (size * sizeOf dummy)
246++#if __GLASGOW_HASKELL__ >= 706
247++ doMalloc undefined
248++ where
249++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
250++ doMalloc dummy size =
251++ mallocPlainForeignPtrAlignedBytes (size * sizeOf dummy) (alignment dummy)
252++#elif __GLASGOW_HASKELL__ >= 700
253++ doMalloc undefined
254++ where
255++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
256++ doMalloc dummy size = do
257++ arr@(MutableByteArray arr#) <- newAlignedPinnedByteArray arrSize arrAlign
258++ newConcForeignPtr
259++ (Ptr (byteArrayContents# (unsafeCoerce# arr#)))
260++ -- Keep reference to mutable byte array until whole ForeignPtr goes out
261++ -- of scope.
262++ (touch arr)
263++ where
264++ arrSize = size * sizeOf dummy
265++ arrAlign = alignment dummy
266+ #else
267+ mallocForeignPtrArray
268+ #endif
269+@@ -293,7 +313,7 @@
270+ {-# INLINE new #-}
271+ new = G.new
272+
273+--- | Create a mutable vector of the given length. The length is not checked.
274++-- | Create a mutable vector of the given length. The memory is not initialized.
275+ unsafeNew :: (PrimMonad m, Storable a) => Int -> m (MVector (PrimState m) a)
276+ {-# INLINE unsafeNew #-}
277+ unsafeNew = G.unsafeNew
278+@@ -322,14 +342,14 @@
279+ -- | Grow a vector by the given number of elements. The number must be
280+ -- positive.
281+ grow :: (PrimMonad m, Storable a)
282+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
283++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
284+ {-# INLINE grow #-}
285+ grow = G.grow
286+
287+ -- | Grow a vector by the given number of elements. The number must be
288+ -- positive but this is not checked.
289+ unsafeGrow :: (PrimMonad m, Storable a)
290+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
291++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
292+ {-# INLINE unsafeGrow #-}
293+ unsafeGrow = G.unsafeGrow
294+
295+@@ -401,7 +421,7 @@
296+ -- | Copy a vector. The two vectors must have the same length and may not
297+ -- overlap.
298+ copy :: (PrimMonad m, Storable a)
299+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
300++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
301+ {-# INLINE copy #-}
302+ copy = G.copy
303+
304+@@ -422,7 +442,7 @@
305+ -- copied to a temporary vector and then the temporary vector was copied
306+ -- to the target vector.
307+ move :: (PrimMonad m, Storable a)
308+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
309++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
310+ {-# INLINE move #-}
311+ move = G.move
312+
313+@@ -434,9 +454,9 @@
314+ -- copied to a temporary vector and then the temporary vector was copied
315+ -- to the target vector.
316+ unsafeMove :: (PrimMonad m, Storable a)
317+- => MVector (PrimState m) a -- ^ target
318+- -> MVector (PrimState m) a -- ^ source
319+- -> m ()
320++ => MVector (PrimState m) a -- ^ target
321++ -> MVector (PrimState m) a -- ^ source
322++ -> m ()
323+ {-# INLINE unsafeMove #-}
324+ unsafeMove = G.unsafeMove
325+
326+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs
327+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs 2015-07-13 12:26:16.000000000 +0800
328++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs 2001-09-09 09:46:40.000000000 +0800
329+@@ -169,7 +169,9 @@
330+ import Data.Data ( Data(..) )
331+ import Text.Read ( Read(..), readListPrecDefault )
332+
333++#if !MIN_VERSION_base(4,8,0)
334+ import Data.Monoid ( Monoid(..) )
335++#endif
336+
337+ #if __GLASGOW_HASKELL__ >= 708
338+ import qualified GHC.Exts as Exts
339+@@ -783,7 +785,7 @@
340+ mapM_ = G.mapM_
341+
342+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
343+--- vector of results. Equvalent to @flip 'mapM'@.
344++-- vector of results. Equivalent to @flip 'mapM'@.
345+ forM :: (Monad m, Storable a, Storable b) => Vector a -> (a -> m b) -> m (Vector b)
346+ {-# INLINE forM #-}
347+ forM = G.forM
348+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs
349+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2015-07-13 12:26:16.000000000 +0800
350++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2001-09-09 09:46:40.000000000 +0800
351+@@ -30,10 +30,14 @@
352+ import Control.Monad.Primitive
353+ import Control.Monad ( liftM )
354+
355+-import Data.Word ( Word, Word8, Word16, Word32, Word64 )
356++import Data.Word ( Word8, Word16, Word32, Word64 )
357+ import Data.Int ( Int8, Int16, Int32, Int64 )
358+ import Data.Complex
359+
360++#if !MIN_VERSION_base(4,8,0)
361++import Data.Word ( Word )
362++#endif
363++
364+ #if __GLASGOW_HASKELL__ >= 707
365+ import Data.Typeable ( Typeable )
366+ #else
367+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs
368+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
369++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
370+@@ -149,7 +149,7 @@
371+ {-# INLINE new #-}
372+ new = G.new
373+
374+--- | Create a mutable vector of the given length. The length is not checked.
375++-- | Create a mutable vector of the given length. The memory is not initialized.
376+ unsafeNew :: (PrimMonad m, Unbox a) => Int -> m (MVector (PrimState m) a)
377+ {-# INLINE unsafeNew #-}
378+ unsafeNew = G.unsafeNew
379+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs
380+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2015-07-13 12:26:16.000000000 +0800
381++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2001-09-09 09:46:40.000000000 +0800
382+@@ -186,7 +186,9 @@
383+
384+ import Text.Read ( Read(..), readListPrecDefault )
385+
386++#if !MIN_VERSION_base(4,8,0)
387+ import Data.Monoid ( Monoid(..) )
388++#endif
389+
390+ #if __GLASGOW_HASKELL__ >= 708
391+ import qualified GHC.Exts as Exts (IsList(..))
392+@@ -820,7 +822,7 @@
393+ imapM_ = G.imapM_
394+
395+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
396+--- vector of results. Equvalent to @flip 'mapM'@.
397++-- vector of results. Equivalent to @flip 'mapM'@.
398+ forM :: (Monad m, Unbox a, Unbox b) => Vector a -> (a -> m b) -> m (Vector b)
399+ {-# INLINE forM #-}
400+ forM = G.forM
401+diff -ur hackage-package-vector-0.11.0.0/Data/Vector.hs ghc-package-vector-0.11.0.0/Data/Vector.hs
402+--- hackage-package-vector-0.11.0.0/Data/Vector.hs 2015-07-13 12:26:16.000000000 +0800
403++++ ghc-package-vector-0.11.0.0/Data/Vector.hs 2001-09-09 09:46:40.000000000 +0800
404+@@ -150,7 +150,7 @@
405+ -- * Conversions
406+
407+ -- ** Lists
408+- toList, fromList, fromListN,
409++ toList, Data.Vector.fromList, Data.Vector.fromListN,
410+
411+ -- ** Other vector types
412+ G.convert,
413+@@ -187,11 +187,14 @@
414+ import Data.Data ( Data(..) )
415+ import Text.Read ( Read(..), readListPrecDefault )
416+
417+-import Data.Monoid ( Monoid(..) )
418+ import qualified Control.Applicative as Applicative
419+ import qualified Data.Foldable as Foldable
420+ import qualified Data.Traversable as Traversable
421+
422++#if !MIN_VERSION_base(4,8,0)
423++import Data.Monoid ( Monoid(..) )
424++#endif
425++
426+ #if __GLASGOW_HASKELL__ >= 708
427+ import qualified GHC.Exts as Exts (IsList(..))
428+ #endif
429+@@ -220,8 +223,8 @@
430+
431+ instance Exts.IsList (Vector a) where
432+ type Item (Vector a) = a
433+- fromList = fromList
434+- fromListN = fromListN
435++ fromList = Data.Vector.fromList
436++ fromListN = Data.Vector.fromListN
437+ toList = toList
438+ #endif
439+
440+@@ -297,7 +300,7 @@
441+
442+ instance Monad Vector where
443+ {-# INLINE return #-}
444+- return = singleton
445++ return = Applicative.pure
446+
447+ {-# INLINE (>>=) #-}
448+ (>>=) = flip concatMap
449+@@ -341,7 +344,7 @@
450+
451+ instance Traversable.Traversable Vector where
452+ {-# INLINE traverse #-}
453+- traverse f xs = fromList Applicative.<$> Traversable.traverse f (toList xs)
454++ traverse f xs = Data.Vector.fromList Applicative.<$> Traversable.traverse f (toList xs)
455+
456+ {-# INLINE mapM #-}
457+ mapM = mapM
458+@@ -917,7 +920,7 @@
459+ imapM_ = G.imapM_
460+
461+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
462+--- vector of results. Equvalent to @flip 'mapM'@.
463++-- vector of results. Equivalent to @flip 'mapM'@.
464+ forM :: Monad m => Vector a -> (a -> m b) -> m (Vector b)
465+ {-# INLINE forM #-}
466+ forM = G.forM
467+diff -ur hackage-package-vector-0.11.0.0/include/vector.h ghc-package-vector-0.11.0.0/include/vector.h
468+--- hackage-package-vector-0.11.0.0/include/vector.h 2015-07-13 12:26:16.000000000 +0800
469++++ ghc-package-vector-0.11.0.0/include/vector.h 2001-09-09 09:46:40.000000000 +0800
470+@@ -18,4 +18,3 @@
471+
472+ #define PHASE_STREAM Please use "PHASE_FUSED" instead
473+ #define INLINE_STREAM Please use "INLINE_FUSED" instead
474+-
475+diff -ur hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs
476+--- hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs 2015-07-13 12:26:16.000000000 +0800
477++++ ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs 2001-09-09 09:46:40.000000000 +0800
478+@@ -643,6 +643,7 @@
479+ testGroup "Data.Vector.Storable.Vector (Double)" (testNumericStorableVector (undefined :: Data.Vector.Storable.Vector Double)),
480+
481+ testGroup "Data.Vector.Unboxed.Vector ()" (testUnitUnboxedVector (undefined :: Data.Vector.Unboxed.Vector ())),
482++ testGroup "Data.Vector.Unboxed.Vector (Bool)" (testBoolUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Bool)),
483+ testGroup "Data.Vector.Unboxed.Vector (Int)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Int)),
484+ testGroup "Data.Vector.Unboxed.Vector (Double)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Double)),
485+ testGroup "Data.Vector.Unboxed.Vector (Int,Bool)" (testTupleUnboxedVector (undefined :: Data.Vector.Unboxed.Vector (Int,Bool))),
486+diff -ur hackage-package-vector-0.11.0.0/vector.cabal ghc-package-vector-0.11.0.0/vector.cabal
487+--- hackage-package-vector-0.11.0.0/vector.cabal 2015-07-13 12:26:16.000000000 +0800
488++++ ghc-package-vector-0.11.0.0/vector.cabal 2001-09-09 09:46:40.000000000 +0800
489+@@ -38,6 +38,7 @@
490+ Build-Type: Simple
491+
492+ Extra-Source-Files:
493++ changelog
494+ README.md
495+ tests/LICENSE
496+ tests/Setup.hs
497+@@ -137,9 +138,9 @@
498+ Install-Includes:
499+ vector.h
500+
501+- Build-Depends: base >= 4.3 && < 4.9
502++ Build-Depends: base >= 4.3 && < 4.10
503+ , primitive >= 0.5.0.1 && < 0.7
504+- , ghc-prim >= 0.2 && < 0.5
505++ , ghc-prim >= 0.2 && < 0.6
506+ , deepseq >= 1.1 && < 1.5
507+
508+ Ghc-Options: -O2 -Wall -fno-warn-orphans
patches/ghc844/array-0.5.2.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-array-0.5.2.0/array.cabal ghc-package-array-0.5.2.0/array.cabal
2+--- hackage-package-array-0.5.2.0/array.cabal 2017-07-04 06:06:07.000000000 +0800
3++++ ghc-package-array-0.5.2.0/array.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -37,7 +37,7 @@
5+ Trustworthy,
6+ UnboxedTuples,
7+ UnliftedFFITypes
8+- build-depends: base >= 4.7 && < 4.11
9++ build-depends: base >= 4.7 && < 4.12
10+ ghc-options: -Wall
11+ exposed-modules:
12+ Data.Array
patches/ghc844/deepseq-1.4.3.0.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-deepseq-1.4.3.0/deepseq.cabal ghc-package-deepseq-1.4.3.0/deepseq.cabal
2+--- hackage-package-deepseq-1.4.3.0/deepseq.cabal 2017-07-20 06:00:58.000000000 +0800
3++++ ghc-package-deepseq-1.4.3.0/deepseq.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -61,7 +61,7 @@
5+ if impl(ghc>=7.8)
6+ other-extensions: EmptyCase
7+
8+- build-depends: base >= 4.5 && < 4.11,
9++ build-depends: base >= 4.5 && < 4.12,
10+ array >= 0.4 && < 0.6
11+ ghc-options: -Wall
12+
patches/ghc844/default.nixnew file+12
@@ -0,0 +1,12 @@
1+{
2+ packages.array.patches = [ ./array-0.5.2.0.patch ];
3+ packages.deepseq.patches = [ ./deepseq-1.4.3.0.patch ];
4+ packages.default.nix.patches = [ ./default.nix ];
5+ packages.hpc.patches = [ ./hpc-0.6.0.3.patch ];
6+ packages.parallel.patches = [ ./parallel-3.2.1.1.patch ];
7+ packages.parsec.patches = [ ./parsec-3.1.13.0.patch ];
8+ packages.random.patches = [ ./random-1.1.patch ];
9+ packages.time.patches = [ ./time-1.8.0.2.patch ];
10+ packages.unix.patches = [ ./unix-2.7.2.2.patch ];
11+ packages.vector.patches = [ ./vector-0.11.0.0.patch ];
12+}
patches/ghc844/hpc-0.6.0.3.patchnew file+16
@@ -0,0 +1,16 @@
1+diff -ur hackage-package-hpc-0.6.0.3/hpc.cabal ghc-package-hpc-0.6.0.3/hpc.cabal
2+--- hackage-package-hpc-0.6.0.3/hpc.cabal 2016-05-04 18:47:19.000000000 +0800
3++++ ghc-package-hpc-0.6.0.3/hpc.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -35,9 +35,9 @@
5+ Trace.Hpc.Reflect
6+
7+ Build-Depends:
8+- base >= 4.4.1 && < 4.10,
9++ base >= 4.4.1 && < 4.12,
10+ containers >= 0.4.1 && < 0.6,
11+- directory >= 1.1 && < 1.3,
12++ directory >= 1.1 && < 1.4,
13+ filepath >= 1 && < 1.5,
14+- time >= 1.2 && < 1.7
15++ time >= 1.2 && < 1.9
16+ ghc-options: -Wall
patches/ghc844/parallel-3.2.1.1.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ur hackage-package-parallel-3.2.1.1/parallel.cabal ghc-package-parallel-3.2.1.1/parallel.cabal
2+--- hackage-package-parallel-3.2.1.1/parallel.cabal 2017-04-09 00:25:01.000000000 +0800
3++++ ghc-package-parallel-3.2.1.1/parallel.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -34,7 +34,7 @@
5+
6+ build-depends:
7+ array >= 0.3 && < 0.6,
8+- base >= 4.3 && < 4.11,
9++ base >= 4.3 && < 4.12,
10+ containers >= 0.4 && < 0.6,
11+ deepseq >= 1.1 && < 1.5
12+
patches/ghc844/parsec-3.1.13.0.patchnew file+23
@@ -0,0 +1,23 @@
1+diff -ur hackage-package-parsec-3.1.13.0/parsec.cabal ghc-package-parsec-3.1.13.0/parsec.cabal
2+--- hackage-package-parsec-3.1.13.0/parsec.cabal 2018-02-06 17:13:02.000000000 +0800
3++++ ghc-package-parsec-3.1.13.0/parsec.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -21,8 +21,8 @@
5+ license-file: LICENSE
6+ author: Daan Leijen <daan@microsoft.com>, Paolo Martini <paolo@nemail.it>, Antoine Latter <aslatter@gmail.com>
7+ maintainer: Herbert Valerio Riedel <hvr@gnu.org>
8+-homepage: https://github.com/hvr/parsec
9+-bug-reports: https://github.com/hvr/parsec/issues
10++homepage: https://github.com/haskell/parsec
11++bug-reports: https://github.com/haskell/parsec/issues
12+ category: Parsing
13+
14+ build-type: Simple
15+@@ -32,7 +32,7 @@
16+
17+ source-repository head
18+ type: git
19+- location: https://github.com/hvr/parsec
20++ location: https://github.com/haskell/parsec
21+
22+ library
23+ hs-source-dirs: src
patches/ghc844/random-1.1.patchnew file+406
@@ -0,0 +1,406 @@
1+diff -ur hackage-package-random-1.1/README.md ghc-package-random-1.1/README.md
2+--- hackage-package-random-1.1/README.md 2014-09-17 05:34:43.000000000 +0800
3++++ ghc-package-random-1.1/README.md 2001-09-09 09:46:40.000000000 +0800
4+@@ -10,7 +10,7 @@
5+
6+ A module supplying this interface is required for Haskell 98 (but not Haskell
7+ 2010). An older [version]
8+-(http://www.haskell.org/ghc/docs/latest/html/libraries/haskell98/Random.html)
9++(https://downloads.haskell.org/~ghc/latest/docs/html/libraries/haskell98-2.0.0.3/Random.html)
10+ of this library is included with GHC in the haskell98 package. This newer
11+ version, with compatible api, is included in the [Haskell Platform]
12+ (http://www.haskell.org/platform/contents.html).
13+diff -ur hackage-package-random-1.1/System/Random.hs ghc-package-random-1.1/System/Random.hs
14+--- hackage-package-random-1.1/System/Random.hs 2014-09-17 05:34:43.000000000 +0800
15++++ ghc-package-random-1.1/System/Random.hs 2001-09-09 09:46:40.000000000 +0800
16+@@ -7,7 +7,7 @@
17+ -- Module : System.Random
18+ -- Copyright : (c) The University of Glasgow 2001
19+ -- License : BSD-style (see the file LICENSE in the 'random' repository)
20+---
21++--
22+ -- Maintainer : libraries@haskell.org
23+ -- Stability : stable
24+ -- Portability : portable
25+@@ -18,7 +18,7 @@
26+ -- or to get different results on each run by using the system-initialised
27+ -- generator or by supplying a seed from some other source.
28+ --
29+--- The library is split into two layers:
30++-- The library is split into two layers:
31+ --
32+ -- * A core /random number generator/ provides a supply of bits.
33+ -- The class 'RandomGen' provides a common interface to such generators.
34+@@ -40,40 +40,40 @@
35+ #include "MachDeps.h"
36+
37+ module System.Random
38+- (
39++ (
40+
41+- -- $intro
42++ -- $intro
43+
44+- -- * Random number generators
45++ -- * Random number generators
46+
47+ #ifdef ENABLE_SPLITTABLEGEN
48+- RandomGen(next, genRange)
49+- , SplittableGen(split)
50++ RandomGen(next, genRange)
51++ , SplittableGen(split)
52+ #else
53+- RandomGen(next, genRange, split)
54++ RandomGen(next, genRange, split)
55+ #endif
56+- -- ** Standard random number generators
57+- , StdGen
58+- , mkStdGen
59++ -- ** Standard random number generators
60++ , StdGen
61++ , mkStdGen
62+
63+- -- ** The global random number generator
64++ -- ** The global random number generator
65+
66+- -- $globalrng
67++ -- $globalrng
68+
69+- , getStdRandom
70+- , getStdGen
71+- , setStdGen
72+- , newStdGen
73++ , getStdRandom
74++ , getStdGen
75++ , setStdGen
76++ , newStdGen
77+
78+- -- * Random values of various types
79+- , Random ( random, randomR,
80+- randoms, randomRs,
81+- randomIO, randomRIO )
82++ -- * Random values of various types
83++ , Random ( random, randomR,
84++ randoms, randomRs,
85++ randomIO, randomRIO )
86+
87+- -- * References
88+- -- $references
89++ -- * References
90++ -- $references
91+
92+- ) where
93++ ) where
94+
95+ import Prelude
96+
97+@@ -83,15 +83,15 @@
98+ import Foreign.C.Types
99+
100+ #ifdef __NHC__
101+-import CPUTime ( getCPUTime )
102++import CPUTime ( getCPUTime )
103+ import Foreign.Ptr ( Ptr, nullPtr )
104+-import Foreign.C ( CTime, CUInt )
105++import Foreign.C ( CTime, CUInt )
106+ #else
107+-import System.CPUTime ( getCPUTime )
108+-import Data.Time ( getCurrentTime, UTCTime(..) )
109++import System.CPUTime ( getCPUTime )
110++import Data.Time ( getCurrentTime, UTCTime(..) )
111+ import Data.Ratio ( numerator, denominator )
112+ #endif
113+-import Data.Char ( isSpace, chr, ord )
114++import Data.Char ( isSpace, chr, ord )
115+ import System.IO.Unsafe ( unsafePerformIO )
116+ import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
117+ #if MIN_VERSION_base (4,6,0)
118+@@ -99,7 +99,7 @@
119+ #else
120+ import Data.IORef ( atomicModifyIORef )
121+ #endif
122+-import Numeric ( readDec )
123++import Numeric ( readDec )
124+
125+ #ifdef __GLASGOW_HASKELL__
126+ import GHC.Exts ( build )
127+@@ -201,17 +201,17 @@
128+
129+ In addition, 'reads' may be used to map an arbitrary string (not necessarily one
130+ produced by 'show') onto a value of type 'StdGen'. In general, the 'Read'
131+-instance of 'StdGen' has the following properties:
132++instance of 'StdGen' has the following properties:
133+
134+-* It guarantees to succeed on any string.
135++* It guarantees to succeed on any string.
136+
137+-* It guarantees to consume only a finite portion of the string.
138++* It guarantees to consume only a finite portion of the string.
139+
140+ * Different argument strings are likely to result in different results.
141+
142+ -}
143+
144+-data StdGen
145++data StdGen
146+ = StdGen !Int32 !Int32
147+
148+ instance RandomGen StdGen where
149+@@ -224,8 +224,8 @@
150+ split = stdSplit
151+
152+ instance Show StdGen where
153+- showsPrec p (StdGen s1 s2) =
154+- showsPrec p s1 .
155++ showsPrec p (StdGen s1 s2) =
156++ showsPrec p s1 .
157+ showChar ' ' .
158+ showsPrec p s2
159+
160+@@ -234,11 +234,11 @@
161+ case try_read r of
162+ r'@[_] -> r'
163+ _ -> [stdFromString r] -- because it shouldn't ever fail.
164+- where
165++ where
166+ try_read r = do
167+ (s1, r1) <- readDec (dropWhile isSpace r)
168+- (s2, r2) <- readDec (dropWhile isSpace r1)
169+- return (StdGen s1 s2, r2)
170++ (s2, r2) <- readDec (dropWhile isSpace r1)
171++ return (StdGen s1 s2, r2)
172+
173+ {-
174+ If we cannot unravel the StdGen from a string, create
175+@@ -246,7 +246,7 @@
176+ -}
177+ stdFromString :: String -> (StdGen, String)
178+ stdFromString s = (mkStdGen num, rest)
179+- where (cs, rest) = splitAt 6 s
180++ where (cs, rest) = splitAt 6 s
181+ num = foldl (\a x -> x + 3 * a) 1 (map ord cs)
182+
183+
184+@@ -266,11 +266,11 @@
185+ mkStdGen32 :: Int32 -> StdGen
186+ mkStdGen32 sMaybeNegative = StdGen (s1+1) (s2+1)
187+ where
188+- -- We want a non-negative number, but we can't just take the abs
189+- -- of sMaybeNegative as -minBound == minBound.
190+- s = sMaybeNegative .&. maxBound
191+- (q, s1) = s `divMod` 2147483562
192+- s2 = q `mod` 2147483398
193++ -- We want a non-negative number, but we can't just take the abs
194++ -- of sMaybeNegative as -minBound == minBound.
195++ s = sMaybeNegative .&. maxBound
196++ (q, s1) = s `divMod` 2147483562
197++ s2 = q `mod` 2147483398
198+
199+ createStdGen :: Integer -> StdGen
200+ createStdGen s = mkStdGen32 $ fromIntegral s
201+@@ -323,7 +323,7 @@
202+ -- | A variant of 'random' that uses the global random number generator
203+ -- (see "System.Random#globalrng").
204+ randomIO :: IO a
205+- randomIO = getStdRandom random
206++ randomIO = getStdRandom random
207+
208+ -- | Produce an infinite list-equivalent of random values.
209+ {-# INLINE buildRandoms #-}
210+@@ -340,7 +340,7 @@
211+
212+ instance Random Integer where
213+ randomR ival g = randomIvalInteger ival g
214+- random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
215++ random g = randomR (toInteger (minBound::Int), toInteger (maxBound::Int)) g
216+
217+ instance Random Int where randomR = randomIvalIntegral; random = randomBounded
218+ instance Random Int8 where randomR = randomIvalIntegral; random = randomBounded
219+@@ -378,13 +378,13 @@
220+ instance Random CUIntMax where randomR = randomIvalIntegral; random = randomBounded
221+
222+ instance Random Char where
223+- randomR (a,b) g =
224++ randomR (a,b) g =
225+ case (randomIvalInteger (toInteger (ord a), toInteger (ord b)) g) of
226+ (x,g') -> (chr x, g')
227+- random g = randomR (minBound,maxBound) g
228++ random g = randomR (minBound,maxBound) g
229+
230+ instance Random Bool where
231+- randomR (a,b) g =
232++ randomR (a,b) g =
233+ case (randomIvalInteger (bool2Int a, bool2Int b) g) of
234+ (x, g') -> (int2Bool x, g')
235+ where
236+@@ -392,42 +392,42 @@
237+ bool2Int False = 0
238+ bool2Int True = 1
239+
240+- int2Bool :: Int -> Bool
241+- int2Bool 0 = False
242+- int2Bool _ = True
243++ int2Bool :: Int -> Bool
244++ int2Bool 0 = False
245++ int2Bool _ = True
246+
247+- random g = randomR (minBound,maxBound) g
248++ random g = randomR (minBound,maxBound) g
249+
250+ {-# INLINE randomRFloating #-}
251+ randomRFloating :: (Fractional a, Num a, Ord a, Random a, RandomGen g) => (a, a) -> g -> (a, g)
252+-randomRFloating (l,h) g
253++randomRFloating (l,h) g
254+ | l>h = randomRFloating (h,l) g
255+- | otherwise = let (coef,g') = random g in
256+- (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
257++ | otherwise = let (coef,g') = random g in
258++ (2.0 * (0.5*l + coef * (0.5*h - 0.5*l)), g') -- avoid overflow
259+
260+ instance Random Double where
261+ randomR = randomRFloating
262+- random rng =
263+- case random rng of
264+- (x,rng') ->
265++ random rng =
266++ case random rng of
267++ (x,rng') ->
268+ -- We use 53 bits of randomness corresponding to the 53 bit significand:
269+- ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
270+- / fromIntegral twoto53, rng')
271+- where
272++ ((fromIntegral (mask53 .&. (x::Int64)) :: Double)
273++ / fromIntegral twoto53, rng')
274++ where
275+ twoto53 = (2::Int64) ^ (53::Int64)
276+ mask53 = twoto53 - 1
277+-
278++
279+ instance Random Float where
280+ randomR = randomRFloating
281+- random rng =
282+- -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
283+- case random rng of
284+- (x,rng') ->
285++ random rng =
286++ -- TODO: Faster to just use 'next' IF it generates enough bits of randomness.
287++ case random rng of
288++ (x,rng') ->
289+ -- We use 24 bits of randomness corresponding to the 24 bit significand:
290+- ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
291+- / fromIntegral twoto24, rng')
292+- -- Note, encodeFloat is another option, but I'm not seeing slightly
293+- -- worse performance with the following [2011.06.25]:
294++ ((fromIntegral (mask24 .&. (x::Int32)) :: Float)
295++ / fromIntegral twoto24, rng')
296++ -- Note, encodeFloat is another option, but I'm not seeing slightly
297++ -- worse performance with the following [2011.06.25]:
298+ -- (encodeFloat rand (-24), rng')
299+ where
300+ mask24 = twoto24 - 1
301+@@ -436,8 +436,8 @@
302+ -- CFloat/CDouble are basically the same as a Float/Double:
303+ instance Random CFloat where
304+ randomR = randomRFloating
305+- random rng = case random rng of
306+- (x,rng') -> (realToFrac (x::Float), rng')
307++ random rng = case random rng of
308++ (x,rng') -> (realToFrac (x::Float), rng')
309+
310+ instance Random CDouble where
311+ randomR = randomRFloating
312+@@ -445,8 +445,8 @@
313+ -- Presently, this is showing better performance than the Double instance:
314+ -- (And yet, if the Double instance uses randomFrac then its performance is much worse!)
315+ random = randomFrac
316+- -- random rng = case random rng of
317+- -- (x,rng') -> (realToFrac (x::Double), rng')
318++ -- random rng = case random rng of
319++ -- (x,rng') -> (realToFrac (x::Double), rng')
320+
321+ mkStdRNG :: Integer -> IO StdGen
322+ mkStdRNG o = do
323+@@ -463,7 +463,7 @@
324+
325+ {-# SPECIALIZE randomIvalInteger :: (Num a) =>
326+ (Integer, Integer) -> StdGen -> (a, StdGen) #-}
327+-
328++
329+ randomIvalInteger :: (RandomGen g, Num a) => (Integer, Integer) -> g -> (a, g)
330+ randomIvalInteger (l,h) rng
331+ | l > h = randomIvalInteger (h,l) rng
332+@@ -482,7 +482,7 @@
333+ k = h - l + 1
334+ magtgt = k * q
335+
336+- -- generate random values until we exceed the target magnitude
337++ -- generate random values until we exceed the target magnitude
338+ f mag v g | mag >= magtgt = (v, g)
339+ | otherwise = v' `seq`f (mag*b) v' g' where
340+ (x,g') = next g
341+@@ -494,18 +494,18 @@
342+ randomFrac = randomIvalDouble (0::Double,1) realToFrac
343+
344+ randomIvalDouble :: (RandomGen g, Fractional a) => (Double, Double) -> (Double -> a) -> g -> (a, g)
345+-randomIvalDouble (l,h) fromDouble rng
346++randomIvalDouble (l,h) fromDouble rng
347+ | l > h = randomIvalDouble (h,l) fromDouble rng
348+- | otherwise =
349++ | otherwise =
350+ case (randomIvalInteger (toInteger (minBound::Int32), toInteger (maxBound::Int32)) rng) of
351+- (x, rng') ->
352+- let
353+- scaled_x =
354+- fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
355++ (x, rng') ->
356++ let
357++ scaled_x =
358++ fromDouble (0.5*l + 0.5*h) + -- previously (l+h)/2, overflowed
359+ fromDouble ((0.5*h - 0.5*l) / (0.5 * realToFrac int32Count)) * -- avoid overflow
360+- fromIntegral (x::Int32)
361+- in
362+- (scaled_x, rng')
363++ fromIntegral (x::Int32)
364++ in
365++ (scaled_x, rng')
366+
367+ int32Count :: Integer
368+ int32Count = toInteger (maxBound::Int32) - toInteger (minBound::Int32) + 1 -- GHC ticket #3982
369+@@ -516,16 +516,16 @@
370+ stdNext :: StdGen -> (Int, StdGen)
371+ -- Returns values in the range stdRange
372+ stdNext (StdGen s1 s2) = (fromIntegral z', StdGen s1'' s2'')
373+- where z' = if z < 1 then z + 2147483562 else z
374+- z = s1'' - s2''
375++ where z' = if z < 1 then z + 2147483562 else z
376++ z = s1'' - s2''
377+
378+- k = s1 `quot` 53668
379+- s1' = 40014 * (s1 - k * 53668) - k * 12211
380+- s1'' = if s1' < 0 then s1' + 2147483563 else s1'
381+-
382+- k' = s2 `quot` 52774
383+- s2' = 40692 * (s2 - k' * 52774) - k' * 3791
384+- s2'' = if s2' < 0 then s2' + 2147483399 else s2'
385++ k = s1 `quot` 53668
386++ s1' = 40014 * (s1 - k * 53668) - k * 12211
387++ s1'' = if s1' < 0 then s1' + 2147483563 else s1'
388++
389++ k' = s2 `quot` 52774
390++ s2' = 40692 * (s2 - k' * 52774) - k' * 3791
391++ s2'' = if s2' < 0 then s2' + 2147483399 else s2'
392+
393+ stdSplit :: StdGen -> (StdGen, StdGen)
394+ stdSplit std@(StdGen s1 s2)
395+diff -ur hackage-package-random-1.1/random.cabal ghc-package-random-1.1/random.cabal
396+--- hackage-package-random-1.1/random.cabal 2014-09-17 05:34:43.000000000 +0800
397++++ ghc-package-random-1.1/random.cabal 2001-09-09 09:46:40.000000000 +0800
398+@@ -40,7 +40,7 @@
399+
400+ source-repository head
401+ type: git
402+- location: http://git.haskell.org/packages/random.git
403++ location: https://github.com/haskell/random.git
404+
405+ -- To run the Test-Suite:
406+ -- $ cabal configure --enable-tests
patches/ghc844/time-1.8.0.2.patchnew file+146
@@ -0,0 +1,146 @@
1+diff -ur hackage-package-time-1.8.0.2/configure ghc-package-time-1.8.0.2/configure
2+--- hackage-package-time-1.8.0.2/configure 2016-12-07 03:31:54.000000000 +0800
3++++ ghc-package-time-1.8.0.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,6 +1,6 @@
5+ #! /bin/sh
6+ # Guess values for system-dependent variables and create Makefiles.
7+-# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.
8++# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.0.2.
9+ #
10+ # Report bugs to <ashley@semantic.org>.
11+ #
12+@@ -580,8 +580,8 @@
13+ # Identity of this package.
14+ PACKAGE_NAME='Haskell time package'
15+ PACKAGE_TARNAME='time'
16+-PACKAGE_VERSION='1.8'
17+-PACKAGE_STRING='Haskell time package 1.8'
18++PACKAGE_VERSION='1.8.0.2'
19++PACKAGE_STRING='Haskell time package 1.8.0.2'
20+ PACKAGE_BUGREPORT='ashley@semantic.org'
21+ PACKAGE_URL=''
22+
23+@@ -653,7 +653,6 @@
24+ docdir
25+ oldincludedir
26+ includedir
27+-runstatedir
28+ localstatedir
29+ sharedstatedir
30+ sysconfdir
31+@@ -726,7 +725,6 @@
32+ sysconfdir='${prefix}/etc'
33+ sharedstatedir='${prefix}/com'
34+ localstatedir='${prefix}/var'
35+-runstatedir='${localstatedir}/run'
36+ includedir='${prefix}/include'
37+ oldincludedir='/usr/include'
38+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
39+@@ -979,15 +977,6 @@
40+ | -silent | --silent | --silen | --sile | --sil)
41+ silent=yes ;;
42+
43+- -runstatedir | --runstatedir | --runstatedi | --runstated \
44+- | --runstate | --runstat | --runsta | --runst | --runs \
45+- | --run | --ru | --r)
46+- ac_prev=runstatedir ;;
47+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
48+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
49+- | --run=* | --ru=* | --r=*)
50+- runstatedir=$ac_optarg ;;
51+-
52+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
53+ ac_prev=sbindir ;;
54+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
55+@@ -1125,7 +1114,7 @@
56+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
57+ datadir sysconfdir sharedstatedir localstatedir includedir \
58+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
59+- libdir localedir mandir runstatedir
60++ libdir localedir mandir
61+ do
62+ eval ac_val=\$$ac_var
63+ # Remove trailing slashes.
64+@@ -1238,7 +1227,7 @@
65+ # Omit some internal or obsolete options to make the list less imposing.
66+ # This message is too long to be a string in the A/UX 3.1 sh.
67+ cat <<_ACEOF
68+-\`configure' configures Haskell time package 1.8 to adapt to many kinds of systems.
69++\`configure' configures Haskell time package 1.8.0.2 to adapt to many kinds of systems.
70+
71+ Usage: $0 [OPTION]... [VAR=VALUE]...
72+
73+@@ -1278,7 +1267,6 @@
74+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
75+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
76+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
77+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
78+ --libdir=DIR object code libraries [EPREFIX/lib]
79+ --includedir=DIR C header files [PREFIX/include]
80+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
81+@@ -1300,7 +1288,7 @@
82+
83+ if test -n "$ac_init_help"; then
84+ case $ac_init_help in
85+- short | recursive ) echo "Configuration of Haskell time package 1.8:";;
86++ short | recursive ) echo "Configuration of Haskell time package 1.8.0.2:";;
87+ esac
88+ cat <<\_ACEOF
89+
90+@@ -1386,7 +1374,7 @@
91+ test -n "$ac_init_help" && exit $ac_status
92+ if $ac_init_version; then
93+ cat <<\_ACEOF
94+-Haskell time package configure 1.8
95++Haskell time package configure 1.8.0.2
96+ generated by GNU Autoconf 2.69
97+
98+ Copyright (C) 2012 Free Software Foundation, Inc.
99+@@ -1858,7 +1846,7 @@
100+ This file contains any messages produced by compilers while
101+ running configure, to aid debugging if configure makes a mistake.
102+
103+-It was created by Haskell time package $as_me 1.8, which was
104++It was created by Haskell time package $as_me 1.8.0.2, which was
105+ generated by GNU Autoconf 2.69. Invocation command line was
106+
107+ $ $0 $@
108+@@ -4193,7 +4181,7 @@
109+ # report actual input values of CONFIG_FILES etc. instead of their
110+ # values after options handling.
111+ ac_log="
112+-This file was extended by Haskell time package $as_me 1.8, which was
113++This file was extended by Haskell time package $as_me 1.8.0.2, which was
114+ generated by GNU Autoconf 2.69. Invocation command line was
115+
116+ CONFIG_FILES = $CONFIG_FILES
117+@@ -4246,7 +4234,7 @@
118+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
119+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
120+ ac_cs_version="\\
121+-Haskell time package config.status 1.8
122++Haskell time package config.status 1.8.0.2
123+ configured by $0, generated by GNU Autoconf 2.69,
124+ with options \\"\$ac_cs_config\\"
125+
126+diff -ur hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h
127+--- hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2017-05-13 18:29:46.000000000 +0800
128++++ ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2001-09-09 09:46:40.000000000 +0800
129+@@ -69,7 +69,7 @@
130+ #define PACKAGE_NAME "Haskell time package"
131+
132+ /* Define to the full name and version of this package. */
133+-#define PACKAGE_STRING "Haskell time package 1.8"
134++#define PACKAGE_STRING "Haskell time package 1.8.0.2"
135+
136+ /* Define to the one symbol short name of this package. */
137+ #define PACKAGE_TARNAME "time"
138+@@ -78,7 +78,7 @@
139+ #define PACKAGE_URL ""
140+
141+ /* Define to the version of this package. */
142+-#define PACKAGE_VERSION "1.8"
143++#define PACKAGE_VERSION "1.8.0.2"
144+
145+ /* Define to 1 if you have the ANSI C header files. */
146+ #define STDC_HEADERS 1
patches/ghc844/unix-2.7.2.2.patchnew file+109
@@ -0,0 +1,109 @@
1+diff -ur hackage-package-unix-2.7.2.2/configure ghc-package-unix-2.7.2.2/configure
2+--- hackage-package-unix-2.7.2.2/configure 2017-07-20 06:04:36.000000000 +0800
3++++ ghc-package-unix-2.7.2.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -667,7 +667,6 @@
5+ docdir
6+ oldincludedir
7+ includedir
8+-runstatedir
9+ localstatedir
10+ sharedstatedir
11+ sysconfdir
12+@@ -739,7 +738,6 @@
13+ sysconfdir='${prefix}/etc'
14+ sharedstatedir='${prefix}/com'
15+ localstatedir='${prefix}/var'
16+-runstatedir='${localstatedir}/run'
17+ includedir='${prefix}/include'
18+ oldincludedir='/usr/include'
19+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
20+@@ -992,15 +990,6 @@
21+ | -silent | --silent | --silen | --sile | --sil)
22+ silent=yes ;;
23+
24+- -runstatedir | --runstatedir | --runstatedi | --runstated \
25+- | --runstate | --runstat | --runsta | --runst | --runs \
26+- | --run | --ru | --r)
27+- ac_prev=runstatedir ;;
28+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
29+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
30+- | --run=* | --ru=* | --r=*)
31+- runstatedir=$ac_optarg ;;
32+-
33+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
34+ ac_prev=sbindir ;;
35+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
36+@@ -1138,7 +1127,7 @@
37+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
38+ datadir sysconfdir sharedstatedir localstatedir includedir \
39+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
40+- libdir localedir mandir runstatedir
41++ libdir localedir mandir
42+ do
43+ eval ac_val=\$$ac_var
44+ # Remove trailing slashes.
45+@@ -1291,7 +1280,6 @@
46+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
47+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
48+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
49+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
50+ --libdir=DIR object code libraries [EPREFIX/lib]
51+ --includedir=DIR C header files [PREFIX/include]
52+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
53+@@ -3782,7 +3770,7 @@
54+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
55+ since some C++ compilers masquerading as C compilers
56+ incorrectly reject 9223372036854775807. */
57+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
58++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
59+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
60+ && LARGE_OFF_T % 2147483647 == 1)
61+ ? 1 : -1];
62+@@ -3828,7 +3816,7 @@
63+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
64+ since some C++ compilers masquerading as C compilers
65+ incorrectly reject 9223372036854775807. */
66+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
67++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
68+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
69+ && LARGE_OFF_T % 2147483647 == 1)
70+ ? 1 : -1];
71+@@ -3852,7 +3840,7 @@
72+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
73+ since some C++ compilers masquerading as C compilers
74+ incorrectly reject 9223372036854775807. */
75+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
76++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
77+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
78+ && LARGE_OFF_T % 2147483647 == 1)
79+ ? 1 : -1];
80+@@ -3897,7 +3885,7 @@
81+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
82+ since some C++ compilers masquerading as C compilers
83+ incorrectly reject 9223372036854775807. */
84+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
85++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
86+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
87+ && LARGE_OFF_T % 2147483647 == 1)
88+ ? 1 : -1];
89+@@ -3921,7 +3909,7 @@
90+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
91+ since some C++ compilers masquerading as C compilers
92+ incorrectly reject 9223372036854775807. */
93+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
94++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
95+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
96+ && LARGE_OFF_T % 2147483647 == 1)
97+ ? 1 : -1];
98+diff -ur hackage-package-unix-2.7.2.2/unix.cabal ghc-package-unix-2.7.2.2/unix.cabal
99+--- hackage-package-unix-2.7.2.2/unix.cabal 2017-07-20 06:04:36.000000000 +0800
100++++ ghc-package-unix-2.7.2.2/unix.cabal 2001-09-09 09:46:40.000000000 +0800
101+@@ -62,7 +62,7 @@
102+ buildable: False
103+
104+ build-depends:
105+- base >= 4.5 && < 4.11,
106++ base >= 4.5 && < 4.12,
107+ bytestring >= 0.9.2 && < 0.11,
108+ time >= 1.2 && < 1.9
109+
patches/ghc844/vector-0.11.0.0.patchnew file+508
@@ -0,0 +1,508 @@
1+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs
2+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
3++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -101,12 +101,20 @@
5+ scanl, scanl1,
6+ enumFromTo, enumFromThenTo )
7+
8+-import Data.Int ( Int8, Int16, Int32, Int64 )
9+-import Data.Word ( Word8, Word16, Word32, Word, Word64 )
10++import Data.Int ( Int8, Int16, Int32 )
11++import Data.Word ( Word8, Word16, Word32, Word64 )
12++
13++#if !MIN_VERSION_base(4,8,0)
14++import Data.Word ( Word )
15++#endif
16+
17+ #include "vector.h"
18+ #include "MachDeps.h"
19+
20++#if WORD_SIZE_IN_BITS > 32
21++import Data.Int ( Int64 )
22++#endif
23++
24+ data Chunk v a = Chunk Int (forall m. (PrimMonad m, Vector v a) => Mutable v (PrimState m) a -> m ())
25+
26+ -- | Monadic streams
27+@@ -888,6 +896,7 @@
28+ :: Monad m => Integer -> Integer -> Bundle m v Integer #-}
29+
30+
31++#if WORD_SIZE_IN_BITS > 32
32+
33+ -- FIXME: the "too large" test is totally wrong
34+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Bundle m v a
35+@@ -906,7 +915,6 @@
36+ step z | z <= y = return $ Yield z (z+1)
37+ | otherwise = return $ Done
38+
39+-#if WORD_SIZE_IN_BITS > 32
40+
41+ {-# RULES
42+
43+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs
44+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2015-07-13 12:26:16.000000000 +0800
45++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Bundle.hs 2001-09-09 09:46:40.000000000 +0800
46+@@ -111,7 +111,7 @@
47+ type MBundle = M.Bundle
48+
49+ inplace :: (forall m. Monad m => S.Stream m a -> S.Stream m b)
50+- -> (Size -> Size) -> Bundle v a -> Bundle v b
51++ -> (Size -> Size) -> Bundle v a -> Bundle v b
52+ {-# INLINE_FUSED inplace #-}
53+ inplace f g b = b `seq` M.fromStream (f (M.elements b)) (g (M.size b))
54+
55+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs
56+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2015-07-13 12:26:16.000000000 +0800
57++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Stream/Monadic.hs 2001-09-09 09:46:40.000000000 +0800
58+@@ -89,8 +89,12 @@
59+ scanl, scanl1,
60+ enumFromTo, enumFromThenTo )
61+
62+-import Data.Int ( Int8, Int16, Int32, Int64 )
63++import Data.Int ( Int8, Int16, Int32 )
64++import Data.Word ( Word8, Word16, Word32, Word64 )
65++
66++#if !MIN_VERSION_base(4,8,0)
67+ import Data.Word ( Word8, Word16, Word32, Word, Word64 )
68++#endif
69+
70+ #if __GLASGOW_HASKELL__ >= 708
71+ import GHC.Types ( SPEC(..) )
72+@@ -101,6 +105,10 @@
73+ #include "vector.h"
74+ #include "MachDeps.h"
75+
76++#if WORD_SIZE_IN_BITS > 32
77++import Data.Int ( Int64 )
78++#endif
79++
80+ #if __GLASGOW_HASKELL__ < 708
81+ data SPEC = SPEC | SPEC2
82+ #if __GLASGOW_HASKELL__ >= 700
83+@@ -1403,6 +1411,8 @@
84+
85+
86+
87++#if WORD_SIZE_IN_BITS > 32
88++
89+ -- FIXME: the "too large" test is totally wrong
90+ enumFromTo_big_int :: (Integral a, Monad m) => a -> a -> Stream m a
91+ {-# INLINE_FUSED enumFromTo_big_int #-}
92+@@ -1412,8 +1422,6 @@
93+ step z | z <= y = return $ Yield z (z+1)
94+ | otherwise = return $ Done
95+
96+-#if WORD_SIZE_IN_BITS > 32
97+-
98+ {-# RULES
99+
100+ "enumFromTo<Int64> [Stream]"
101+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs
102+--- hackage-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2015-07-13 12:26:16.000000000 +0800
103++++ ghc-package-vector-0.11.0.0/Data/Vector/Fusion/Util.hs 2001-09-09 09:46:40.000000000 +0800
104+@@ -1,3 +1,4 @@
105++{-# LANGUAGE CPP #-}
106+ -- |
107+ -- Module : Data.Vector.Fusion.Util
108+ -- Copyright : (c) Roman Leshchinskiy 2009
109+@@ -16,7 +17,9 @@
110+ delay_inline, delayed_min
111+ ) where
112+
113++#if !MIN_VERSION_base(4,8,0)
114+ import Control.Applicative (Applicative(..))
115++#endif
116+
117+ -- | Identity monad
118+ newtype Id a = Id { unId :: a }
119+@@ -29,7 +32,7 @@
120+ Id f <*> Id x = Id (f x)
121+
122+ instance Monad Id where
123+- return = Id
124++ return = pure
125+ Id x >>= f = f x
126+
127+ -- | Box monad
128+@@ -43,7 +46,7 @@
129+ Box f <*> Box x = Box (f x)
130+
131+ instance Monad Box where
132+- return = Box
133++ return = pure
134+ Box x >>= f = f x
135+
136+ -- | Delay inlining a function until late in the game (simplifier phase 0).
137+@@ -55,4 +58,3 @@
138+ delayed_min :: Int -> Int -> Int
139+ {-# INLINE [0] delayed_min #-}
140+ delayed_min m n = min m n
141+-
142+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs
143+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
144++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
145+@@ -584,7 +584,7 @@
146+ new n = BOUNDS_CHECK(checkLength) "new" n
147+ $ unsafeNew n >>= \v -> basicInitialize v >> return v
148+
149+--- | Create a mutable vector of the given length. The length is not checked.
150++-- | Create a mutable vector of the given length. The memory is not initialized.
151+ unsafeNew :: (PrimMonad m, MVector v a) => Int -> m (v (PrimState m) a)
152+ {-# INLINE unsafeNew #-}
153+ unsafeNew n = UNSAFE_CHECK(checkLength) "unsafeNew" n
154+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs
155+--- hackage-package-vector-0.11.0.0/Data/Vector/Generic.hs 2015-07-13 12:26:16.000000000 +0800
156++++ ghc-package-vector-0.11.0.0/Data/Vector/Generic.hs 2001-09-09 09:46:40.000000000 +0800
157+@@ -1038,7 +1038,7 @@
158+ imapM_ f = Bundle.mapM_ (uncurry f) . Bundle.indexed . stream
159+
160+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
161+--- vector of results. Equvalent to @flip 'mapM'@.
162++-- vector of results. Equivalent to @flip 'mapM'@.
163+ forM :: (Monad m, Vector v a, Vector v b) => v a -> (a -> m b) -> m (v b)
164+ {-# INLINE forM #-}
165+ forM as f = mapM f as
166+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs
167+--- hackage-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
168++++ ghc-package-vector-0.11.0.0/Data/Vector/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
169+@@ -268,7 +268,7 @@
170+ {-# INLINE new #-}
171+ new = G.new
172+
173+--- | Create a mutable vector of the given length. The length is not checked.
174++-- | Create a mutable vector of the given length. The memory is not initialized.
175+ unsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) a)
176+ {-# INLINE unsafeNew #-}
177+ unsafeNew = G.unsafeNew
178+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs
179+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
180++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
181+@@ -211,7 +211,7 @@
182+ {-# INLINE new #-}
183+ new = G.new
184+
185+--- | Create a mutable vector of the given length. The length is not checked.
186++-- | Create a mutable vector of the given length. The memory is not initialized.
187+ unsafeNew :: (PrimMonad m, Prim a) => Int -> m (MVector (PrimState m) a)
188+ {-# INLINE unsafeNew #-}
189+ unsafeNew = G.unsafeNew
190+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs
191+--- hackage-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2015-07-13 12:26:16.000000000 +0800
192++++ ghc-package-vector-0.11.0.0/Data/Vector/Primitive.hs 2001-09-09 09:46:40.000000000 +0800
193+@@ -164,7 +164,9 @@
194+ import Data.Data ( Data(..) )
195+ import Text.Read ( Read(..), readListPrecDefault )
196+
197++#if !MIN_VERSION_base(4,8,0)
198+ import Data.Monoid ( Monoid(..) )
199++#endif
200+
201+ #if __GLASGOW_HASKELL__ >= 708
202+ import qualified GHC.Exts as Exts
203+@@ -773,7 +775,7 @@
204+ mapM_ = G.mapM_
205+
206+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
207+--- vector of results. Equvalent to @flip 'mapM'@.
208++-- vector of results. Equivalent to @flip 'mapM'@.
209+ forM :: (Monad m, Prim a, Prim b) => Vector a -> (a -> m b) -> m (Vector b)
210+ {-# INLINE forM #-}
211+ forM = G.forM
212+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs
213+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
214++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
215+@@ -1,4 +1,4 @@
216+-{-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, ScopedTypeVariables #-}
217++{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, MagicHash, MultiParamTypeClasses, ScopedTypeVariables #-}
218+
219+ -- |
220+ -- Module : Data.Vector.Storable.Mutable
221+@@ -65,8 +65,13 @@
222+ import Foreign.Storable
223+ import Foreign.ForeignPtr
224+
225+-#if __GLASGOW_HASKELL__ >= 605
226+-import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
227++#if __GLASGOW_HASKELL__ >= 706
228++import GHC.ForeignPtr (mallocPlainForeignPtrAlignedBytes)
229++#elif __GLASGOW_HASKELL__ >= 700
230++import Data.Primitive.ByteArray (MutableByteArray(..), newAlignedPinnedByteArray,
231++ unsafeFreezeByteArray)
232++import GHC.Prim (byteArrayContents#, unsafeCoerce#)
233++import GHC.ForeignPtr
234+ #endif
235+
236+ import Foreign.Ptr
237+@@ -201,11 +206,26 @@
238+ {-# INLINE mallocVector #-}
239+ mallocVector :: Storable a => Int -> IO (ForeignPtr a)
240+ mallocVector =
241+-#if __GLASGOW_HASKELL__ >= 605
242+- doMalloc undefined
243+- where
244+- doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
245+- doMalloc dummy size = mallocPlainForeignPtrBytes (size * sizeOf dummy)
246++#if __GLASGOW_HASKELL__ >= 706
247++ doMalloc undefined
248++ where
249++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
250++ doMalloc dummy size =
251++ mallocPlainForeignPtrAlignedBytes (size * sizeOf dummy) (alignment dummy)
252++#elif __GLASGOW_HASKELL__ >= 700
253++ doMalloc undefined
254++ where
255++ doMalloc :: Storable b => b -> Int -> IO (ForeignPtr b)
256++ doMalloc dummy size = do
257++ arr@(MutableByteArray arr#) <- newAlignedPinnedByteArray arrSize arrAlign
258++ newConcForeignPtr
259++ (Ptr (byteArrayContents# (unsafeCoerce# arr#)))
260++ -- Keep reference to mutable byte array until whole ForeignPtr goes out
261++ -- of scope.
262++ (touch arr)
263++ where
264++ arrSize = size * sizeOf dummy
265++ arrAlign = alignment dummy
266+ #else
267+ mallocForeignPtrArray
268+ #endif
269+@@ -293,7 +313,7 @@
270+ {-# INLINE new #-}
271+ new = G.new
272+
273+--- | Create a mutable vector of the given length. The length is not checked.
274++-- | Create a mutable vector of the given length. The memory is not initialized.
275+ unsafeNew :: (PrimMonad m, Storable a) => Int -> m (MVector (PrimState m) a)
276+ {-# INLINE unsafeNew #-}
277+ unsafeNew = G.unsafeNew
278+@@ -322,14 +342,14 @@
279+ -- | Grow a vector by the given number of elements. The number must be
280+ -- positive.
281+ grow :: (PrimMonad m, Storable a)
282+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
283++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
284+ {-# INLINE grow #-}
285+ grow = G.grow
286+
287+ -- | Grow a vector by the given number of elements. The number must be
288+ -- positive but this is not checked.
289+ unsafeGrow :: (PrimMonad m, Storable a)
290+- => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
291++ => MVector (PrimState m) a -> Int -> m (MVector (PrimState m) a)
292+ {-# INLINE unsafeGrow #-}
293+ unsafeGrow = G.unsafeGrow
294+
295+@@ -401,7 +421,7 @@
296+ -- | Copy a vector. The two vectors must have the same length and may not
297+ -- overlap.
298+ copy :: (PrimMonad m, Storable a)
299+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
300++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
301+ {-# INLINE copy #-}
302+ copy = G.copy
303+
304+@@ -422,7 +442,7 @@
305+ -- copied to a temporary vector and then the temporary vector was copied
306+ -- to the target vector.
307+ move :: (PrimMonad m, Storable a)
308+- => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
309++ => MVector (PrimState m) a -> MVector (PrimState m) a -> m ()
310+ {-# INLINE move #-}
311+ move = G.move
312+
313+@@ -434,9 +454,9 @@
314+ -- copied to a temporary vector and then the temporary vector was copied
315+ -- to the target vector.
316+ unsafeMove :: (PrimMonad m, Storable a)
317+- => MVector (PrimState m) a -- ^ target
318+- -> MVector (PrimState m) a -- ^ source
319+- -> m ()
320++ => MVector (PrimState m) a -- ^ target
321++ -> MVector (PrimState m) a -- ^ source
322++ -> m ()
323+ {-# INLINE unsafeMove #-}
324+ unsafeMove = G.unsafeMove
325+
326+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs
327+--- hackage-package-vector-0.11.0.0/Data/Vector/Storable.hs 2015-07-13 12:26:16.000000000 +0800
328++++ ghc-package-vector-0.11.0.0/Data/Vector/Storable.hs 2001-09-09 09:46:40.000000000 +0800
329+@@ -169,7 +169,9 @@
330+ import Data.Data ( Data(..) )
331+ import Text.Read ( Read(..), readListPrecDefault )
332+
333++#if !MIN_VERSION_base(4,8,0)
334+ import Data.Monoid ( Monoid(..) )
335++#endif
336+
337+ #if __GLASGOW_HASKELL__ >= 708
338+ import qualified GHC.Exts as Exts
339+@@ -783,7 +785,7 @@
340+ mapM_ = G.mapM_
341+
342+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
343+--- vector of results. Equvalent to @flip 'mapM'@.
344++-- vector of results. Equivalent to @flip 'mapM'@.
345+ forM :: (Monad m, Storable a, Storable b) => Vector a -> (a -> m b) -> m (Vector b)
346+ {-# INLINE forM #-}
347+ forM = G.forM
348+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs
349+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2015-07-13 12:26:16.000000000 +0800
350++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Base.hs 2001-09-09 09:46:40.000000000 +0800
351+@@ -30,10 +30,14 @@
352+ import Control.Monad.Primitive
353+ import Control.Monad ( liftM )
354+
355+-import Data.Word ( Word, Word8, Word16, Word32, Word64 )
356++import Data.Word ( Word8, Word16, Word32, Word64 )
357+ import Data.Int ( Int8, Int16, Int32, Int64 )
358+ import Data.Complex
359+
360++#if !MIN_VERSION_base(4,8,0)
361++import Data.Word ( Word )
362++#endif
363++
364+ #if __GLASGOW_HASKELL__ >= 707
365+ import Data.Typeable ( Typeable )
366+ #else
367+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs
368+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2015-07-13 12:26:16.000000000 +0800
369++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed/Mutable.hs 2001-09-09 09:46:40.000000000 +0800
370+@@ -149,7 +149,7 @@
371+ {-# INLINE new #-}
372+ new = G.new
373+
374+--- | Create a mutable vector of the given length. The length is not checked.
375++-- | Create a mutable vector of the given length. The memory is not initialized.
376+ unsafeNew :: (PrimMonad m, Unbox a) => Int -> m (MVector (PrimState m) a)
377+ {-# INLINE unsafeNew #-}
378+ unsafeNew = G.unsafeNew
379+diff -ur hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs
380+--- hackage-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2015-07-13 12:26:16.000000000 +0800
381++++ ghc-package-vector-0.11.0.0/Data/Vector/Unboxed.hs 2001-09-09 09:46:40.000000000 +0800
382+@@ -186,7 +186,9 @@
383+
384+ import Text.Read ( Read(..), readListPrecDefault )
385+
386++#if !MIN_VERSION_base(4,8,0)
387+ import Data.Monoid ( Monoid(..) )
388++#endif
389+
390+ #if __GLASGOW_HASKELL__ >= 708
391+ import qualified GHC.Exts as Exts (IsList(..))
392+@@ -820,7 +822,7 @@
393+ imapM_ = G.imapM_
394+
395+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
396+--- vector of results. Equvalent to @flip 'mapM'@.
397++-- vector of results. Equivalent to @flip 'mapM'@.
398+ forM :: (Monad m, Unbox a, Unbox b) => Vector a -> (a -> m b) -> m (Vector b)
399+ {-# INLINE forM #-}
400+ forM = G.forM
401+diff -ur hackage-package-vector-0.11.0.0/Data/Vector.hs ghc-package-vector-0.11.0.0/Data/Vector.hs
402+--- hackage-package-vector-0.11.0.0/Data/Vector.hs 2015-07-13 12:26:16.000000000 +0800
403++++ ghc-package-vector-0.11.0.0/Data/Vector.hs 2001-09-09 09:46:40.000000000 +0800
404+@@ -150,7 +150,7 @@
405+ -- * Conversions
406+
407+ -- ** Lists
408+- toList, fromList, fromListN,
409++ toList, Data.Vector.fromList, Data.Vector.fromListN,
410+
411+ -- ** Other vector types
412+ G.convert,
413+@@ -187,11 +187,14 @@
414+ import Data.Data ( Data(..) )
415+ import Text.Read ( Read(..), readListPrecDefault )
416+
417+-import Data.Monoid ( Monoid(..) )
418+ import qualified Control.Applicative as Applicative
419+ import qualified Data.Foldable as Foldable
420+ import qualified Data.Traversable as Traversable
421+
422++#if !MIN_VERSION_base(4,8,0)
423++import Data.Monoid ( Monoid(..) )
424++#endif
425++
426+ #if __GLASGOW_HASKELL__ >= 708
427+ import qualified GHC.Exts as Exts (IsList(..))
428+ #endif
429+@@ -220,8 +223,8 @@
430+
431+ instance Exts.IsList (Vector a) where
432+ type Item (Vector a) = a
433+- fromList = fromList
434+- fromListN = fromListN
435++ fromList = Data.Vector.fromList
436++ fromListN = Data.Vector.fromListN
437+ toList = toList
438+ #endif
439+
440+@@ -297,7 +300,7 @@
441+
442+ instance Monad Vector where
443+ {-# INLINE return #-}
444+- return = singleton
445++ return = Applicative.pure
446+
447+ {-# INLINE (>>=) #-}
448+ (>>=) = flip concatMap
449+@@ -341,7 +344,7 @@
450+
451+ instance Traversable.Traversable Vector where
452+ {-# INLINE traverse #-}
453+- traverse f xs = fromList Applicative.<$> Traversable.traverse f (toList xs)
454++ traverse f xs = Data.Vector.fromList Applicative.<$> Traversable.traverse f (toList xs)
455+
456+ {-# INLINE mapM #-}
457+ mapM = mapM
458+@@ -917,7 +920,7 @@
459+ imapM_ = G.imapM_
460+
461+ -- | /O(n)/ Apply the monadic action to all elements of the vector, yielding a
462+--- vector of results. Equvalent to @flip 'mapM'@.
463++-- vector of results. Equivalent to @flip 'mapM'@.
464+ forM :: Monad m => Vector a -> (a -> m b) -> m (Vector b)
465+ {-# INLINE forM #-}
466+ forM = G.forM
467+diff -ur hackage-package-vector-0.11.0.0/include/vector.h ghc-package-vector-0.11.0.0/include/vector.h
468+--- hackage-package-vector-0.11.0.0/include/vector.h 2015-07-13 12:26:16.000000000 +0800
469++++ ghc-package-vector-0.11.0.0/include/vector.h 2001-09-09 09:46:40.000000000 +0800
470+@@ -18,4 +18,3 @@
471+
472+ #define PHASE_STREAM Please use "PHASE_FUSED" instead
473+ #define INLINE_STREAM Please use "INLINE_FUSED" instead
474+-
475+diff -ur hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs
476+--- hackage-package-vector-0.11.0.0/tests/Tests/Vector.hs 2015-07-13 12:26:16.000000000 +0800
477++++ ghc-package-vector-0.11.0.0/tests/Tests/Vector.hs 2001-09-09 09:46:40.000000000 +0800
478+@@ -643,6 +643,7 @@
479+ testGroup "Data.Vector.Storable.Vector (Double)" (testNumericStorableVector (undefined :: Data.Vector.Storable.Vector Double)),
480+
481+ testGroup "Data.Vector.Unboxed.Vector ()" (testUnitUnboxedVector (undefined :: Data.Vector.Unboxed.Vector ())),
482++ testGroup "Data.Vector.Unboxed.Vector (Bool)" (testBoolUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Bool)),
483+ testGroup "Data.Vector.Unboxed.Vector (Int)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Int)),
484+ testGroup "Data.Vector.Unboxed.Vector (Double)" (testNumericUnboxedVector (undefined :: Data.Vector.Unboxed.Vector Double)),
485+ testGroup "Data.Vector.Unboxed.Vector (Int,Bool)" (testTupleUnboxedVector (undefined :: Data.Vector.Unboxed.Vector (Int,Bool))),
486+diff -ur hackage-package-vector-0.11.0.0/vector.cabal ghc-package-vector-0.11.0.0/vector.cabal
487+--- hackage-package-vector-0.11.0.0/vector.cabal 2015-07-13 12:26:16.000000000 +0800
488++++ ghc-package-vector-0.11.0.0/vector.cabal 2001-09-09 09:46:40.000000000 +0800
489+@@ -38,6 +38,7 @@
490+ Build-Type: Simple
491+
492+ Extra-Source-Files:
493++ changelog
494+ README.md
495+ tests/LICENSE
496+ tests/Setup.hs
497+@@ -137,9 +138,9 @@
498+ Install-Includes:
499+ vector.h
500+
501+- Build-Depends: base >= 4.3 && < 4.9
502++ Build-Depends: base >= 4.3 && < 4.10
503+ , primitive >= 0.5.0.1 && < 0.7
504+- , ghc-prim >= 0.2 && < 0.5
505++ , ghc-prim >= 0.2 && < 0.6
506+ , deepseq >= 1.1 && < 1.5
507+
508+ Ghc-Options: -O2 -Wall -fno-warn-orphans
patches/ghc861/array-0.5.2.0.patchnew file+302
@@ -0,0 +1,302 @@
1+diff -ur hackage-package-array-0.5.2.0/Data/Array/Base.hs ghc-package-array-0.5.2.0/Data/Array/Base.hs
2+--- hackage-package-array-0.5.2.0/Data/Array/Base.hs 2017-07-04 06:06:07.000000000 +0800
3++++ ghc-package-array-0.5.2.0/Data/Array/Base.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,5 +1,15 @@
5+-{-# LANGUAGE BangPatterns, CPP, RankNTypes, MagicHash, UnboxedTuples, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, DeriveDataTypeable, UnliftedFFITypes #-}
6+-{-# LANGUAGE RoleAnnotations #-}
7++{-# LANGUAGE
8++ BangPatterns
9++ , CPP
10++ , RankNTypes
11++ , MagicHash
12++ , UnboxedTuples
13++ , MultiParamTypeClasses
14++ , FlexibleInstances
15++ , FlexibleContexts
16++ , UnliftedFFITypes
17++ , RoleAnnotations
18++ #-}
19+ {-# OPTIONS_HADDOCK hide #-}
20+
21+ -----------------------------------------------------------------------------
22+@@ -39,7 +49,6 @@
23+ import GHC.IO ( stToIO )
24+ import GHC.IOArray ( IOArray(..),
25+ newIOArray, unsafeReadIOArray, unsafeWriteIOArray )
26+-import Data.Typeable
27+
28+ #include "MachDeps.h"
29+
30+@@ -398,7 +407,6 @@
31+ -- "Data.Array.Unboxed" instead of "Data.Array").
32+ --
33+ data UArray i e = UArray !i !i !Int ByteArray#
34+- deriving Typeable
35+ -- There are class-based invariants on both parameters. See also #9220.
36+ type role UArray nominal nominal
37+
38+@@ -979,7 +987,6 @@
39+ -- don\'t use 'STUArray' if you require the non-strictness that
40+ -- 'STArray' provides.
41+ data STUArray s i e = STUArray !i !i !Int (MutableByteArray# s)
42+- deriving Typeable
43+ -- The "ST" parameter must be nominal for the safety of the ST trick.
44+ -- The other parameters have class constraints. See also #9220.
45+ type role STUArray nominal nominal nominal
46+@@ -1370,11 +1377,7 @@
47+ -- use the safe array creation function here.
48+ return (listArray (l,u) es)
49+
50+-#if __GLASGOW_HASKELL__ >= 711
51+ freezeSTUArray :: STUArray s i e -> ST s (UArray i e)
52+-#else
53+-freezeSTUArray :: Ix i => STUArray s i e -> ST s (UArray i e)
54+-#endif
55+ freezeSTUArray (STUArray l u n marr#) = ST $ \s1# ->
56+ case sizeofMutableByteArray# marr# of { n# ->
57+ case newByteArray# n# s1# of { (# s2#, marr'# #) ->
58+@@ -1449,11 +1452,7 @@
59+ | i <- [0 .. n - 1]]
60+ return marr
61+
62+-#if __GLASGOW_HASKELL__ >= 711
63+ thawSTUArray :: UArray i e -> ST s (STUArray s i e)
64+-#else
65+-thawSTUArray :: Ix i => UArray i e -> ST s (STUArray s i e)
66+-#endif
67+ thawSTUArray (UArray l u n arr#) = ST $ \s1# ->
68+ case sizeofByteArray# arr# of { n# ->
69+ case newByteArray# n# s1# of { (# s2#, marr# #) ->
70+@@ -1513,11 +1512,7 @@
71+ unsafeThaw = thaw
72+
73+ {-# INLINE unsafeThawSTUArray #-}
74+-#if __GLASGOW_HASKELL__ >= 711
75+ unsafeThawSTUArray :: UArray i e -> ST s (STUArray s i e)
76+-#else
77+-unsafeThawSTUArray :: Ix i => UArray i e -> ST s (STUArray s i e)
78+-#endif
79+ unsafeThawSTUArray (UArray l u n marr#) =
80+ return (STUArray l u n (unsafeCoerce# marr#))
81+
82+@@ -1527,11 +1522,7 @@
83+ #-}
84+
85+ {-# INLINE unsafeThawIOArray #-}
86+-#if __GLASGOW_HASKELL__ >= 711
87+ unsafeThawIOArray :: Arr.Array ix e -> IO (IOArray ix e)
88+-#else
89+-unsafeThawIOArray :: Ix ix => Arr.Array ix e -> IO (IOArray ix e)
90+-#endif
91+ unsafeThawIOArray arr = stToIO $ do
92+ marr <- ArrST.unsafeThawSTArray arr
93+ return (IOArray marr)
94+@@ -1540,11 +1531,7 @@
95+ "unsafeThaw/IOArray" unsafeThaw = unsafeThawIOArray
96+ #-}
97+
98+-#if __GLASGOW_HASKELL__ >= 711
99+ thawIOArray :: Arr.Array ix e -> IO (IOArray ix e)
100+-#else
101+-thawIOArray :: Ix ix => Arr.Array ix e -> IO (IOArray ix e)
102+-#endif
103+ thawIOArray arr = stToIO $ do
104+ marr <- ArrST.thawSTArray arr
105+ return (IOArray marr)
106+@@ -1553,11 +1540,7 @@
107+ "thaw/IOArray" thaw = thawIOArray
108+ #-}
109+
110+-#if __GLASGOW_HASKELL__ >= 711
111+ freezeIOArray :: IOArray ix e -> IO (Arr.Array ix e)
112+-#else
113+-freezeIOArray :: Ix ix => IOArray ix e -> IO (Arr.Array ix e)
114+-#endif
115+ freezeIOArray (IOArray marr) = stToIO (ArrST.freezeSTArray marr)
116+
117+ {-# RULES
118+@@ -1565,11 +1548,7 @@
119+ #-}
120+
121+ {-# INLINE unsafeFreezeIOArray #-}
122+-#if __GLASGOW_HASKELL__ >= 711
123+ unsafeFreezeIOArray :: IOArray ix e -> IO (Arr.Array ix e)
124+-#else
125+-unsafeFreezeIOArray :: Ix ix => IOArray ix e -> IO (Arr.Array ix e)
126+-#endif
127+ unsafeFreezeIOArray (IOArray marr) = stToIO (ArrST.unsafeFreezeSTArray marr)
128+
129+ {-# RULES
130+diff -ur hackage-package-array-0.5.2.0/Data/Array/IO/Internals.hs ghc-package-array-0.5.2.0/Data/Array/IO/Internals.hs
131+--- hackage-package-array-0.5.2.0/Data/Array/IO/Internals.hs 2017-07-04 06:06:07.000000000 +0800
132++++ ghc-package-array-0.5.2.0/Data/Array/IO/Internals.hs 2001-09-09 09:46:40.000000000 +0800
133+@@ -1,6 +1,8 @@
134+-{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses,
135+- CPP #-}
136+-{-# LANGUAGE RoleAnnotations #-}
137++{-# LANGUAGE
138++ FlexibleInstances
139++ , MultiParamTypeClasses
140++ , RoleAnnotations
141++ #-}
142+
143+ {-# OPTIONS_HADDOCK hide #-}
144+ -----------------------------------------------------------------------------
145+@@ -27,15 +29,11 @@
146+
147+ import Data.Int
148+ import Data.Word
149+-import Data.Typeable
150+
151+ import Control.Monad.ST ( RealWorld, stToIO )
152+ import Foreign.Ptr ( Ptr, FunPtr )
153+ import Foreign.StablePtr ( StablePtr )
154+
155+-#if __GLASGOW_HASKELL__ < 711
156+-import Data.Ix
157+-#endif
158+ import Data.Array.Base
159+
160+ import GHC.IOArray (IOArray(..))
161+@@ -52,7 +50,6 @@
162+ -- are supported: see "Data.Array.MArray" for a list of instances.
163+ --
164+ newtype IOUArray i e = IOUArray (STUArray RealWorld i e)
165+- deriving Typeable
166+ -- Both parameters have class-based invariants. See also #9220.
167+ type role IOUArray nominal nominal
168+
169+@@ -374,11 +371,7 @@
170+ return (IOUArray marr')
171+
172+ {-# INLINE unsafeThawIOUArray #-}
173+-#if __GLASGOW_HASKELL__ >= 711
174+ unsafeThawIOUArray :: UArray ix e -> IO (IOUArray ix e)
175+-#else
176+-unsafeThawIOUArray :: Ix ix => UArray ix e -> IO (IOUArray ix e)
177+-#endif
178+ unsafeThawIOUArray arr = stToIO $ do
179+ marr <- unsafeThawSTUArray arr
180+ return (IOUArray marr)
181+@@ -387,11 +380,7 @@
182+ "unsafeThaw/IOUArray" unsafeThaw = unsafeThawIOUArray
183+ #-}
184+
185+-#if __GLASGOW_HASKELL__ >= 711
186+ thawIOUArray :: UArray ix e -> IO (IOUArray ix e)
187+-#else
188+-thawIOUArray :: Ix ix => UArray ix e -> IO (IOUArray ix e)
189+-#endif
190+ thawIOUArray arr = stToIO $ do
191+ marr <- thawSTUArray arr
192+ return (IOUArray marr)
193+@@ -401,22 +390,14 @@
194+ #-}
195+
196+ {-# INLINE unsafeFreezeIOUArray #-}
197+-#if __GLASGOW_HASKELL__ >= 711
198+ unsafeFreezeIOUArray :: IOUArray ix e -> IO (UArray ix e)
199+-#else
200+-unsafeFreezeIOUArray :: Ix ix => IOUArray ix e -> IO (UArray ix e)
201+-#endif
202+ unsafeFreezeIOUArray (IOUArray marr) = stToIO (unsafeFreezeSTUArray marr)
203+
204+ {-# RULES
205+ "unsafeFreeze/IOUArray" unsafeFreeze = unsafeFreezeIOUArray
206+ #-}
207+
208+-#if __GLASGOW_HASKELL__ >= 711
209+ freezeIOUArray :: IOUArray ix e -> IO (UArray ix e)
210+-#else
211+-freezeIOUArray :: Ix ix => IOUArray ix e -> IO (UArray ix e)
212+-#endif
213+ freezeIOUArray (IOUArray marr) = stToIO (freezeSTUArray marr)
214+
215+ {-# RULES
216+diff -ur hackage-package-array-0.5.2.0/Data/Array/ST.hs ghc-package-array-0.5.2.0/Data/Array/ST.hs
217+--- hackage-package-array-0.5.2.0/Data/Array/ST.hs 2017-07-04 06:06:07.000000000 +0800
218++++ ghc-package-array-0.5.2.0/Data/Array/ST.hs 2001-09-09 09:46:40.000000000 +0800
219+@@ -1,4 +1,3 @@
220+-{-# LANGUAGE CPP #-}
221+ {-# LANGUAGE RankNTypes #-}
222+ -----------------------------------------------------------------------------
223+ -- |
224+@@ -38,11 +37,7 @@
225+ -- the array before returning it - it uses 'unsafeFreeze' internally, but
226+ -- this wrapper is a safe interface to that function.
227+ --
228+-#if __GLASGOW_HASKELL__ >= 711
229+ runSTArray :: (forall s . ST s (STArray s i e)) -> Array i e
230+-#else
231+-runSTArray :: Ix i => (forall s . ST s (STArray s i e)) -> Array i e
232+-#endif
233+ runSTArray st = runST (st >>= unsafeFreezeSTArray)
234+
235+ -- | A safe way to create and work with an unboxed mutable array before
236+@@ -51,11 +46,7 @@
237+ -- 'unsafeFreeze' internally, but this wrapper is a safe interface to
238+ -- that function.
239+ --
240+-#if __GLASGOW_HASKELL__ >= 711
241+ runSTUArray :: (forall s . ST s (STUArray s i e)) -> UArray i e
242+-#else
243+-runSTUArray :: Ix i => (forall s . ST s (STUArray s i e)) -> UArray i e
244+-#endif
245+ runSTUArray st = runST (st >>= unsafeFreezeSTUArray)
246+
247+
248+diff -ur hackage-package-array-0.5.2.0/Data/Array.hs ghc-package-array-0.5.2.0/Data/Array.hs
249+--- hackage-package-array-0.5.2.0/Data/Array.hs 2017-07-04 06:06:07.000000000 +0800
250++++ ghc-package-array-0.5.2.0/Data/Array.hs 2001-09-09 09:46:40.000000000 +0800
251+@@ -54,8 +54,6 @@
252+ ) where
253+
254+ import Data.Ix
255+-import Data.Typeable ()
256+-
257+ import GHC.Arr -- Most of the hard work is done here
258+
259+ {- $intro
260+diff -ur hackage-package-array-0.5.2.0/array.cabal ghc-package-array-0.5.2.0/array.cabal
261+--- hackage-package-array-0.5.2.0/array.cabal 2017-07-04 06:06:07.000000000 +0800
262++++ ghc-package-array-0.5.2.0/array.cabal 2001-09-09 09:46:40.000000000 +0800
263+@@ -9,7 +9,7 @@
264+ category: Data Structures
265+ build-type: Simple
266+ cabal-version: >=1.10
267+-tested-with: GHC==8.2.1, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4
268++tested-with: GHC==8.4.2, GHC==8.2.1, GHC==8.0.2
269+ description:
270+ In addition to providing the "Data.Array" module
271+ <http://www.haskell.org/onlinereport/haskell2010/haskellch14.html as specified in the Haskell 2010 Language Report>,
272+@@ -28,7 +28,6 @@
273+ other-extensions:
274+ BangPatterns,
275+ CPP,
276+- DeriveDataTypeable,
277+ FlexibleContexts,
278+ FlexibleInstances,
279+ MagicHash,
280+@@ -37,7 +36,7 @@
281+ Trustworthy,
282+ UnboxedTuples,
283+ UnliftedFFITypes
284+- build-depends: base >= 4.7 && < 4.11
285++ build-depends: base >= 4.9 && < 4.13
286+ ghc-options: -Wall
287+ exposed-modules:
288+ Data.Array
289+diff -ur hackage-package-array-0.5.2.0/changelog.md ghc-package-array-0.5.2.0/changelog.md
290+--- hackage-package-array-0.5.2.0/changelog.md 2017-07-04 06:06:07.000000000 +0800
291++++ ghc-package-array-0.5.2.0/changelog.md 2001-09-09 09:46:40.000000000 +0800
292+@@ -1,5 +1,10 @@
293+ # Changelog for [`array` package](http://hackage.haskell.org/package/array)
294+
295++## Next
296++
297++ * Bundled with GHC 8.6.1
298++ * Drop support for GHC versions prior to GHC 8.0
299++
300+ ## 0.5.2.0 *Jul 2017*
301+
302+ * Bundled with GHC 8.2.1
patches/ghc861/binary-0.8.6.0.patchnew file+19
@@ -0,0 +1,19 @@
1+diff -ur hackage-package-binary-0.8.6.0/binary.cabal ghc-package-binary-0.8.6.0/binary.cabal
2+--- hackage-package-binary-0.8.6.0/binary.cabal 2018-08-04 20:33:08.000000000 +0800
3++++ ghc-package-binary-0.8.6.0/binary.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -158,7 +158,6 @@
5+ Data.Binary.Class
6+ Data.Binary.FloatCast
7+ Data.Binary.Generic
8+- Data.Binary.Get
9+ Data.Binary.Get.Internal
10+ Data.Binary.Internal
11+ Data.Binary.Put
12+@@ -191,7 +190,6 @@
13+ Data.Binary.Get
14+ Data.Binary.Get.Internal
15+ Data.Binary.Internal
16+- Data.Binary.Put
17+ build-depends:
18+ base >= 4.5.0.0 && < 5,
19+ bytestring >= 0.10.4,
patches/ghc861/containers-0.6.0.1.patchnew file+1
@@ -0,0 +1 @@
1+Only in hackage-package-containers-0.6.0.1/tests: graph-properties.hs
patches/ghc861/default.nixnew file+12
@@ -0,0 +1,12 @@
1+{
2+ packages.array.patches = [ ./array-0.5.2.0.patch ];
3+ packages.binary.patches = [ ./binary-0.8.6.0.patch ];
4+ packages.containers.patches = [ ./containers-0.6.0.1.patch ];
5+ packages.default.nix.patches = [ ./default.nix ];
6+ packages.hpc.patches = [ ./hpc-0.6.0.3.patch ];
7+ packages.parsec.patches = [ ./parsec-3.1.13.0.patch ];
8+ packages.process.patches = [ ./process-1.6.3.0.patch ];
9+ packages.time.patches = [ ./time-1.8.0.2.patch ];
10+ packages.transformers.patches = [ ./transformers-0.5.5.0.patch ];
11+ packages.unix.patches = [ ./unix-2.7.2.2.patch ];
12+}
patches/ghc861/hpc-0.6.0.3.patchnew file+17
@@ -0,0 +1,17 @@
1+diff -ur hackage-package-hpc-0.6.0.3/hpc.cabal ghc-package-hpc-0.6.0.3/hpc.cabal
2+--- hackage-package-hpc-0.6.0.3/hpc.cabal 2016-05-04 18:47:19.000000000 +0800
3++++ ghc-package-hpc-0.6.0.3/hpc.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -35,9 +35,9 @@
5+ Trace.Hpc.Reflect
6+
7+ Build-Depends:
8+- base >= 4.4.1 && < 4.10,
9+- containers >= 0.4.1 && < 0.6,
10+- directory >= 1.1 && < 1.3,
11++ base >= 4.4.1 && < 4.13,
12++ containers >= 0.4.1 && < 0.7,
13++ directory >= 1.1 && < 1.4,
14+ filepath >= 1 && < 1.5,
15+- time >= 1.2 && < 1.7
16++ time >= 1.2 && < 1.9
17+ ghc-options: -Wall
patches/ghc861/parsec-3.1.13.0.patchnew file+35
@@ -0,0 +1,35 @@
1+diff -ur hackage-package-parsec-3.1.13.0/parsec.cabal ghc-package-parsec-3.1.13.0/parsec.cabal
2+--- hackage-package-parsec-3.1.13.0/parsec.cabal 2018-02-06 17:13:02.000000000 +0800
3++++ ghc-package-parsec-3.1.13.0/parsec.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -21,18 +21,18 @@
5+ license-file: LICENSE
6+ author: Daan Leijen <daan@microsoft.com>, Paolo Martini <paolo@nemail.it>, Antoine Latter <aslatter@gmail.com>
7+ maintainer: Herbert Valerio Riedel <hvr@gnu.org>
8+-homepage: https://github.com/hvr/parsec
9+-bug-reports: https://github.com/hvr/parsec/issues
10++homepage: https://github.com/haskell/parsec
11++bug-reports: https://github.com/haskell/parsec/issues
12+ category: Parsing
13+
14+ build-type: Simple
15+-tested-with: GHC ==8.4.1 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2
16++tested-with: GHC ==8.6.1 || ==8.4.3 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2 || ==7.4.1
17+
18+ extra-source-files: ChangeLog.md, README.md
19+
20+ source-repository head
21+ type: git
22+- location: https://github.com/hvr/parsec
23++ location: https://github.com/haskell/parsec
24+
25+ library
26+ hs-source-dirs: src
27+@@ -64,7 +64,7 @@
28+ Text.ParserCombinators.Parsec.Token
29+
30+ build-depends:
31+- base >= 4.5.1 && < 4.12,
32++ base >= 4.5.0 && < 4.13,
33+ mtl >= 1.1.1 && < 2.3,
34+ bytestring >= 0.9.2.1 && < 0.11,
35+ text >= 0.11.3 && < 1.3
patches/ghc861/process-1.6.3.0.patchnew file+154
@@ -0,0 +1,154 @@
1+diff -ur hackage-package-process-1.6.3.0/System/Process/Common.hs ghc-package-process-1.6.3.0/System/Process/Common.hs
2+--- hackage-package-process-1.6.3.0/System/Process/Common.hs 2017-03-31 01:02:13.000000000 +0800
3++++ ghc-package-process-1.6.3.0/System/Process/Common.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -44,7 +44,7 @@
5+ import GHC.IO.Handle.Types hiding (ClosedHandle)
6+ import System.IO.Error
7+ import Data.Typeable
8+-import GHC.IO.IOMode
9++import System.IO (IOMode)
10+
11+ -- We do a minimal amount of CPP here to provide uniform data types across
12+ -- Windows and POSIX.
13+diff -ur hackage-package-process-1.6.3.0/System/Process/Windows.hsc ghc-package-process-1.6.3.0/System/Process/Windows.hsc
14+--- hackage-package-process-1.6.3.0/System/Process/Windows.hsc 2017-02-21 21:53:00.000000000 +0800
15++++ ghc-package-process-1.6.3.0/System/Process/Windows.hsc 2001-09-09 09:46:40.000000000 +0800
16+@@ -34,7 +34,7 @@
17+ import GHC.IO.Handle.FD
18+ import GHC.IO.Handle.Types hiding (ClosedHandle)
19+ import System.IO.Error
20+-import GHC.IO.IOMode
21++import System.IO (IOMode(..))
22+
23+ import System.Directory ( doesFileExist )
24+ import System.Environment ( getEnv )
25+@@ -208,7 +208,7 @@
26+ then Just <$> peek p_exitCode
27+ else return Nothing
28+
29+-insertItem :: Eq k => MVar [(k, v)] -> k -> v -> IO ()
30++insertItem :: MVar [(k, v)] -> k -> v -> IO ()
31+ insertItem env_ k v = modifyMVar_ env_ (return . ((k, v):))
32+
33+ getItem :: Eq k => MVar [(k, v)] -> k -> IO v
34+diff -ur hackage-package-process-1.6.3.0/System/Process.hs ghc-package-process-1.6.3.0/System/Process.hs
35+--- hackage-package-process-1.6.3.0/System/Process.hs 2017-12-27 17:35:11.000000000 +0800
36++++ ghc-package-process-1.6.3.0/System/Process.hs 2001-09-09 09:46:40.000000000 +0800
37+@@ -43,6 +43,7 @@
38+ readCreateProcessWithExitCode,
39+ readProcessWithExitCode,
40+ withCreateProcess,
41++ cleanupProcess,
42+
43+ -- ** Related utilities
44+ showCommandForUser,
45+@@ -245,7 +246,12 @@
46+ C.bracketOnError (createProcess_ fun c) cleanupProcess
47+ (\(m_in, m_out, m_err, ph) -> action m_in m_out m_err ph)
48+
49+-
50++-- | Cleans up the process.
51++--
52++-- This function is meant to be invoked from any application level cleanup
53++-- handler. It terminates the process, and closes any 'CreatePipe' 'handle's.
54++--
55++-- @since 1.6.4.0
56+ cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
57+ -> IO ()
58+ cleanupProcess (mb_stdin, mb_stdout, mb_stderr,
59+@@ -728,8 +734,10 @@
60+ -- has indeed terminated, use 'getProcessExitCode'.
61+ --
62+ -- On Unix systems, 'terminateProcess' sends the process the SIGTERM signal.
63+--- On Windows systems, the Win32 @TerminateProcess@ function is called, passing
64+--- an exit code of 1.
65++-- On Windows systems, if `use_process_jobs` is `True` then the Win32 @TerminateJobObject@
66++-- function is called to kill all processes associated with the job and passing the
67++-- exit code of 1 to each of them. Otherwise if `use_process_jobs` is `False` then the
68++-- Win32 @TerminateProcess@ function is called, passing an exit code of 1.
69+ --
70+ -- Note: on Windows, if the process was a shell command created by
71+ -- 'createProcess' with 'shell', or created by 'runCommand' or
72+diff -ur hackage-package-process-1.6.3.0/cbits/runProcess.c ghc-package-process-1.6.3.0/cbits/runProcess.c
73+--- hackage-package-process-1.6.3.0/cbits/runProcess.c 2017-02-06 16:42:31.000000000 +0800
74++++ ghc-package-process-1.6.3.0/cbits/runProcess.c 2001-09-09 09:46:40.000000000 +0800
75+@@ -111,6 +111,18 @@
76+ r = pipe(forkCommunicationFds);
77+ if (r == -1) {
78+ *failed_doing = "runInteractiveProcess: pipe";
79++ if (fdStdIn == -1) {
80++ close(fdStdInput[0]);
81++ close(fdStdInput[1]);
82++ }
83++ if (fdStdOut == -1) {
84++ close(fdStdOutput[0]);
85++ close(fdStdOutput[1]);
86++ }
87++ if (fdStdErr == -1) {
88++ close(fdStdError[0]);
89++ close(fdStdError[1]);
90++ }
91+ return -1;
92+ }
93+
94+diff -ur hackage-package-process-1.6.3.0/changelog.md ghc-package-process-1.6.3.0/changelog.md
95+--- hackage-package-process-1.6.3.0/changelog.md 2018-01-22 10:51:34.000000000 +0800
96++++ ghc-package-process-1.6.3.0/changelog.md 2001-09-09 09:46:40.000000000 +0800
97+@@ -1,5 +1,13 @@
98+ # Changelog for [`process` package](http://hackage.haskell.org/package/process)
99+
100++## Unreleased changes
101++
102++* Bug fix: Don't leak pipes on failure
103++ [#122](https://github.com/haskell/process/issues/122)
104++* Expose `cleanupProcess` from `System.Process`
105++ [#130](https://github.com/haskell/process/pull/130)
106++* Drop support for GHC before 7.10.3
107++
108+ ## 1.6.3.0 *January 2018*
109+
110+ * Added `getPid` and export of platform specific `Pid` type
111+diff -ur hackage-package-process-1.6.3.0/process.cabal ghc-package-process-1.6.3.0/process.cabal
112+--- hackage-package-process-1.6.3.0/process.cabal 2018-01-22 10:52:21.000000000 +0800
113++++ ghc-package-process-1.6.3.0/process.cabal 2001-09-09 09:46:40.000000000 +0800
114+@@ -46,8 +46,9 @@
115+ InterruptibleFFI
116+ RecordWildCards
117+ Trustworthy
118+- if impl(ghc>=7.9)
119+- other-extensions: Safe
120++ Safe
121++ if impl(ghc<7.10.3)
122++ buildable: False
123+
124+ exposed-modules:
125+ System.Cmd
126+@@ -61,7 +62,7 @@
127+ cpp-options: -DWINDOWS
128+ else
129+ other-modules: System.Process.Posix
130+- build-depends: unix >= 2.5 && < 2.8
131++ build-depends: unix >= 2.5 && < 2.9
132+
133+ c-sources:
134+ cbits/runProcess.c
135+@@ -74,7 +75,7 @@
136+
137+ ghc-options: -Wall
138+
139+- build-depends: base >= 4.4 && < 4.12,
140++ build-depends: base >= 4.8.2 && < 4.13,
141+ directory >= 1.1 && < 1.4,
142+ filepath >= 1.2 && < 1.5,
143+ deepseq >= 1.1 && < 1.5
144+@@ -84,7 +85,9 @@
145+ hs-source-dirs: test
146+ main-is: main.hs
147+ type: exitcode-stdio-1.0
148+- build-depends: base
149++ -- Add otherwise redundant bounds on base since GHC's build system runs
150++ -- `cabal check`, which mandates bounds on base.
151++ build-depends: base >= 4 && < 5
152+ , bytestring
153+ , directory
154+ , process
patches/ghc861/time-1.8.0.2.patchnew file+146
@@ -0,0 +1,146 @@
1+diff -ur hackage-package-time-1.8.0.2/configure ghc-package-time-1.8.0.2/configure
2+--- hackage-package-time-1.8.0.2/configure 2016-12-07 03:31:54.000000000 +0800
3++++ ghc-package-time-1.8.0.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,6 +1,6 @@
5+ #! /bin/sh
6+ # Guess values for system-dependent variables and create Makefiles.
7+-# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.
8++# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.0.2.
9+ #
10+ # Report bugs to <ashley@semantic.org>.
11+ #
12+@@ -580,8 +580,8 @@
13+ # Identity of this package.
14+ PACKAGE_NAME='Haskell time package'
15+ PACKAGE_TARNAME='time'
16+-PACKAGE_VERSION='1.8'
17+-PACKAGE_STRING='Haskell time package 1.8'
18++PACKAGE_VERSION='1.8.0.2'
19++PACKAGE_STRING='Haskell time package 1.8.0.2'
20+ PACKAGE_BUGREPORT='ashley@semantic.org'
21+ PACKAGE_URL=''
22+
23+@@ -653,7 +653,6 @@
24+ docdir
25+ oldincludedir
26+ includedir
27+-runstatedir
28+ localstatedir
29+ sharedstatedir
30+ sysconfdir
31+@@ -726,7 +725,6 @@
32+ sysconfdir='${prefix}/etc'
33+ sharedstatedir='${prefix}/com'
34+ localstatedir='${prefix}/var'
35+-runstatedir='${localstatedir}/run'
36+ includedir='${prefix}/include'
37+ oldincludedir='/usr/include'
38+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
39+@@ -979,15 +977,6 @@
40+ | -silent | --silent | --silen | --sile | --sil)
41+ silent=yes ;;
42+
43+- -runstatedir | --runstatedir | --runstatedi | --runstated \
44+- | --runstate | --runstat | --runsta | --runst | --runs \
45+- | --run | --ru | --r)
46+- ac_prev=runstatedir ;;
47+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
48+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
49+- | --run=* | --ru=* | --r=*)
50+- runstatedir=$ac_optarg ;;
51+-
52+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
53+ ac_prev=sbindir ;;
54+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
55+@@ -1125,7 +1114,7 @@
56+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
57+ datadir sysconfdir sharedstatedir localstatedir includedir \
58+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
59+- libdir localedir mandir runstatedir
60++ libdir localedir mandir
61+ do
62+ eval ac_val=\$$ac_var
63+ # Remove trailing slashes.
64+@@ -1238,7 +1227,7 @@
65+ # Omit some internal or obsolete options to make the list less imposing.
66+ # This message is too long to be a string in the A/UX 3.1 sh.
67+ cat <<_ACEOF
68+-\`configure' configures Haskell time package 1.8 to adapt to many kinds of systems.
69++\`configure' configures Haskell time package 1.8.0.2 to adapt to many kinds of systems.
70+
71+ Usage: $0 [OPTION]... [VAR=VALUE]...
72+
73+@@ -1278,7 +1267,6 @@
74+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
75+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
76+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
77+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
78+ --libdir=DIR object code libraries [EPREFIX/lib]
79+ --includedir=DIR C header files [PREFIX/include]
80+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
81+@@ -1300,7 +1288,7 @@
82+
83+ if test -n "$ac_init_help"; then
84+ case $ac_init_help in
85+- short | recursive ) echo "Configuration of Haskell time package 1.8:";;
86++ short | recursive ) echo "Configuration of Haskell time package 1.8.0.2:";;
87+ esac
88+ cat <<\_ACEOF
89+
90+@@ -1386,7 +1374,7 @@
91+ test -n "$ac_init_help" && exit $ac_status
92+ if $ac_init_version; then
93+ cat <<\_ACEOF
94+-Haskell time package configure 1.8
95++Haskell time package configure 1.8.0.2
96+ generated by GNU Autoconf 2.69
97+
98+ Copyright (C) 2012 Free Software Foundation, Inc.
99+@@ -1858,7 +1846,7 @@
100+ This file contains any messages produced by compilers while
101+ running configure, to aid debugging if configure makes a mistake.
102+
103+-It was created by Haskell time package $as_me 1.8, which was
104++It was created by Haskell time package $as_me 1.8.0.2, which was
105+ generated by GNU Autoconf 2.69. Invocation command line was
106+
107+ $ $0 $@
108+@@ -4193,7 +4181,7 @@
109+ # report actual input values of CONFIG_FILES etc. instead of their
110+ # values after options handling.
111+ ac_log="
112+-This file was extended by Haskell time package $as_me 1.8, which was
113++This file was extended by Haskell time package $as_me 1.8.0.2, which was
114+ generated by GNU Autoconf 2.69. Invocation command line was
115+
116+ CONFIG_FILES = $CONFIG_FILES
117+@@ -4246,7 +4234,7 @@
118+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
119+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
120+ ac_cs_version="\\
121+-Haskell time package config.status 1.8
122++Haskell time package config.status 1.8.0.2
123+ configured by $0, generated by GNU Autoconf 2.69,
124+ with options \\"\$ac_cs_config\\"
125+
126+diff -ur hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h
127+--- hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2017-05-13 18:29:46.000000000 +0800
128++++ ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2001-09-09 09:46:40.000000000 +0800
129+@@ -69,7 +69,7 @@
130+ #define PACKAGE_NAME "Haskell time package"
131+
132+ /* Define to the full name and version of this package. */
133+-#define PACKAGE_STRING "Haskell time package 1.8"
134++#define PACKAGE_STRING "Haskell time package 1.8.0.2"
135+
136+ /* Define to the one symbol short name of this package. */
137+ #define PACKAGE_TARNAME "time"
138+@@ -78,7 +78,7 @@
139+ #define PACKAGE_URL ""
140+
141+ /* Define to the version of this package. */
142+-#define PACKAGE_VERSION "1.8"
143++#define PACKAGE_VERSION "1.8.0.2"
144+
145+ /* Define to 1 if you have the ANSI C header files. */
146+ #define STDC_HEADERS 1
patches/ghc861/transformers-0.5.5.0.patchnew file+524
@@ -0,0 +1,524 @@
1+diff -ur hackage-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs ghc-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs
2+--- hackage-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs 2017-10-04 23:58:48.000000000 +0800
3++++ ghc-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -27,6 +27,9 @@
5+ ) where
6+
7+ import Data.Functor.Classes
8++#if MIN_VERSION_base(4,12,0)
9++import Data.Functor.Contravariant
10++#endif
11+
12+ import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
13+ import Control.Applicative
14+@@ -100,3 +103,10 @@
15+ {-# INLINE traverse #-}
16+ sequenceA (Backwards t) = fmap Backwards (sequenceA t)
17+ {-# INLINE sequenceA #-}
18++
19++#if MIN_VERSION_base(4,12,0)
20++-- | Derived instance.
21++instance Contravariant f => Contravariant (Backwards f) where
22++ contramap f = Backwards . contramap f . forwards
23++ {-# INLINE contramap #-}
24++#endif
25+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs
26+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs 2017-10-04 23:58:48.000000000 +0800
27++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs 2001-09-09 09:46:40.000000000 +0800
28+@@ -113,7 +113,13 @@
29+
30+ {- $example1
31+
32+-One might define a parsing monad by adding a state (the 'String' remaining
33++The first example is a parser monad in the style of
34++
35++* \"Monadic parsing in Haskell\", by Graham Hutton and Erik Meijer,
36++/Journal of Functional Programming/ 8(4):437-444, July 1998
37++(<http://www.cs.nott.ac.uk/~pszgmh/bib.html#pearl>).
38++
39++We can define such a parser monad by adding a state (the 'String' remaining
40+ to be parsed) to the @[]@ monad, which provides non-determinism:
41+
42+ > import Control.Monad.Trans.State
43+@@ -189,7 +195,8 @@
44+ {- $example3
45+
46+ This example is a cut-down version of the one in
47+-\"Monad Transformers and Modular Interpreters\",
48++
49++* \"Monad Transformers and Modular Interpreters\",
50+ by Sheng Liang, Paul Hudak and Mark Jones in /POPL'95/
51+ (<http://web.cecs.pdx.edu/~mpj/pubs/modinterp.html>).
52+
53+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs
54+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs 2017-10-04 23:58:48.000000000 +0800
55++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs 2001-09-09 09:46:40.000000000 +0800
56+@@ -58,6 +58,9 @@
57+ import Control.Monad.Signatures
58+ import Control.Monad.Trans.Class
59+ import Data.Functor.Classes
60++#if MIN_VERSION_base(4,12,0)
61++import Data.Functor.Contravariant
62++#endif
63+
64+ import Control.Applicative
65+ import Control.Exception (IOException)
66+@@ -263,6 +266,11 @@
67+ instance (Error e, MonadIO m) => MonadIO (ErrorT e m) where
68+ liftIO = lift . liftIO
69+
70++#if MIN_VERSION_base(4,12,0)
71++instance Contravariant m => Contravariant (ErrorT e m) where
72++ contramap f = ErrorT . contramap (fmap f) . runErrorT
73++#endif
74++
75+ -- | Signal an error value @e@.
76+ --
77+ -- * @'runErrorT' ('throwError' e) = 'return' ('Left' e)@
78+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs
79+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs 2017-10-04 23:58:48.000000000 +0800
80++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs 2001-09-09 09:46:40.000000000 +0800
81+@@ -15,7 +15,7 @@
82+ -- Stability : experimental
83+ -- Portability : portable
84+ --
85+--- This monad transformer extends a monad with the ability throw exceptions.
86++-- This monad transformer extends a monad with the ability to throw exceptions.
87+ --
88+ -- A sequence of actions terminates normally, producing a value,
89+ -- only if none of the actions in the sequence throws an exception.
90+@@ -51,6 +51,9 @@
91+ import Control.Monad.Signatures
92+ import Control.Monad.Trans.Class
93+ import Data.Functor.Classes
94++#if MIN_VERSION_base(4,12,0)
95++import Data.Functor.Contravariant
96++#endif
97+ import Data.Functor.Identity
98+
99+ import Control.Applicative
100+@@ -255,6 +258,12 @@
101+ {-# INLINE mzipWith #-}
102+ #endif
103+
104++#if MIN_VERSION_base(4,12,0)
105++instance Contravariant m => Contravariant (ExceptT e m) where
106++ contramap f = ExceptT . contramap (fmap f) . runExceptT
107++ {-# INLINE contramap #-}
108++#endif
109++
110+ -- | Signal an exception value @e@.
111+ --
112+ -- * @'runExceptT' ('throwE' e) = 'return' ('Left' e)@
113+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs
114+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs 2017-10-04 23:58:48.000000000 +0800
115++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs 2001-09-09 09:46:40.000000000 +0800
116+@@ -36,6 +36,9 @@
117+ import Control.Monad.Signatures
118+ import Control.Monad.Trans.Class (MonadTrans(lift))
119+ import Data.Functor.Classes
120++#if MIN_VERSION_base(4,12,0)
121++import Data.Functor.Contravariant
122++#endif
123+
124+ import Control.Applicative
125+ import Control.Monad (MonadPlus(mzero, mplus))
126+@@ -154,6 +157,12 @@
127+ lift = IdentityT
128+ {-# INLINE lift #-}
129+
130++#if MIN_VERSION_base(4,12,0)
131++instance Contravariant f => Contravariant (IdentityT f) where
132++ contramap f = IdentityT . contramap f . runIdentityT
133++ {-# INLINE contramap #-}
134++#endif
135++
136+ -- | Lift a unary operation to the new monad.
137+ mapIdentityT :: (m a -> n b) -> IdentityT m a -> IdentityT n b
138+ mapIdentityT f = IdentityT . f . runIdentityT
139+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs
140+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs 2017-10-04 23:58:48.000000000 +0800
141++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs 2001-09-09 09:46:40.000000000 +0800
142+@@ -34,12 +34,16 @@
143+ import Control.Monad.Signatures
144+ import Control.Monad.Trans.Class
145+ import Data.Functor.Classes
146++#if MIN_VERSION_base(4,12,0)
147++import Data.Functor.Contravariant
148++#endif
149+
150+ import Control.Applicative
151+ import Control.Monad
152+ #if MIN_VERSION_base(4,9,0)
153+ import qualified Control.Monad.Fail as Fail
154+ #endif
155++import Control.Monad.Fix
156+ #if MIN_VERSION_base(4,4,0)
157+ import Control.Monad.Zip (MonadZip(mzipWith))
158+ #endif
159+@@ -137,6 +141,12 @@
160+ return (a ++ b)
161+ {-# INLINE mplus #-}
162+
163++instance (MonadFix m) => MonadFix (ListT m) where
164++ mfix f = ListT $ mfix (runListT . f . head) >>= \ xs -> case xs of
165++ [] -> pure []
166++ x:_ -> (x:) <$> (runListT . mfix) ((mapListT . fmap) tail . f)
167++ {-# INLINE mfix #-}
168++
169+ instance MonadTrans ListT where
170+ lift m = ListT $ do
171+ a <- m
172+@@ -153,6 +163,12 @@
173+ {-# INLINE mzipWith #-}
174+ #endif
175+
176++#if MIN_VERSION_base(4,12,0)
177++instance Contravariant m => Contravariant (ListT m) where
178++ contramap f = ListT . contramap (fmap f) . runListT
179++ {-# INLINE contramap #-}
180++#endif
181++
182+ -- | Lift a @callCC@ operation to the new monad.
183+ liftCallCC :: CallCC m [a] [b] -> CallCC (ListT m) a b
184+ liftCallCC callCC f = ListT $
185+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs
186+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs 2017-10-04 23:58:48.000000000 +0800
187++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs 2001-09-09 09:46:40.000000000 +0800
188+@@ -45,6 +45,9 @@
189+ import Control.Monad.Trans.Class
190+ import Control.Monad.Trans.Except (ExceptT(..))
191+ import Data.Functor.Classes
192++#if MIN_VERSION_base(4,12,0)
193++import Data.Functor.Contravariant
194++#endif
195+
196+ import Control.Applicative
197+ import Control.Monad (MonadPlus(mzero, mplus), liftM)
198+@@ -202,6 +205,12 @@
199+ {-# INLINE mzipWith #-}
200+ #endif
201+
202++#if MIN_VERSION_base(4,12,0)
203++instance Contravariant m => Contravariant (MaybeT m) where
204++ contramap f = MaybeT . contramap (fmap f) . runMaybeT
205++ {-# INLINE contramap #-}
206++#endif
207++
208+ -- | Lift a @callCC@ operation to the new monad.
209+ liftCallCC :: CallCC m (Maybe a) (Maybe b) -> CallCC (MaybeT m) a b
210+ liftCallCC callCC f =
211+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs
212+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
213++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
214+@@ -63,6 +63,9 @@
215+ import Control.Monad.IO.Class
216+ import Control.Monad.Signatures
217+ import Control.Monad.Trans.Class
218++#if MIN_VERSION_base(4,12,0)
219++import Data.Functor.Contravariant
220++#endif
221+ import Data.Functor.Identity
222+
223+ import Control.Applicative
224+@@ -231,6 +234,13 @@
225+ liftIO = lift . liftIO
226+ {-# INLINE liftIO #-}
227+
228++#if MIN_VERSION_base(4,12,0)
229++instance Contravariant m => Contravariant (RWST r w s m) where
230++ contramap f m = RWST $ \r s ->
231++ contramap (\ ~(a, s', w) -> (f a, s', w)) $ runRWST m r s
232++ {-# INLINE contramap #-}
233++#endif
234++
235+ -- ---------------------------------------------------------------------------
236+ -- Reader operations
237+
238+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs
239+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs 2017-10-04 23:58:48.000000000 +0800
240++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs 2001-09-09 09:46:40.000000000 +0800
241+@@ -63,6 +63,9 @@
242+ import Control.Monad.IO.Class
243+ import Control.Monad.Signatures
244+ import Control.Monad.Trans.Class
245++#if MIN_VERSION_base(4,12,0)
246++import Data.Functor.Contravariant
247++#endif
248+ import Data.Functor.Identity
249+
250+ import Control.Applicative
251+@@ -231,6 +234,13 @@
252+ liftIO = lift . liftIO
253+ {-# INLINE liftIO #-}
254+
255++#if MIN_VERSION_base(4,12,0)
256++instance Contravariant m => Contravariant (RWST r w s m) where
257++ contramap f m = RWST $ \r s ->
258++ contramap (\ (a, s', w) -> (f a, s', w)) $ runRWST m r s
259++ {-# INLINE contramap #-}
260++#endif
261++
262+ -- ---------------------------------------------------------------------------
263+ -- Reader operations
264+
265+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs
266+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs 2017-10-04 23:58:48.000000000 +0800
267++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs 2001-09-09 09:46:40.000000000 +0800
268+@@ -49,6 +49,9 @@
269+ import Control.Monad.IO.Class
270+ import Control.Monad.Signatures
271+ import Control.Monad.Trans.Class
272++#if MIN_VERSION_base(4,12,0)
273++import Data.Functor.Contravariant
274++#endif
275+ import Data.Functor.Identity
276+
277+ import Control.Applicative
278+@@ -207,6 +210,12 @@
279+ {-# INLINE mzipWith #-}
280+ #endif
281+
282++#if MIN_VERSION_base(4,12,0)
283++instance Contravariant m => Contravariant (ReaderT r m) where
284++ contramap f = ReaderT . fmap (contramap f) . runReaderT
285++ {-# INLINE contramap #-}
286++#endif
287++
288+ liftReaderT :: m a -> ReaderT r m a
289+ liftReaderT m = ReaderT (const m)
290+ {-# INLINE liftReaderT #-}
291+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs
292+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
293++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
294+@@ -76,6 +76,9 @@
295+ import Control.Monad.IO.Class
296+ import Control.Monad.Signatures
297+ import Control.Monad.Trans.Class
298++#if MIN_VERSION_base(4,12,0)
299++import Data.Functor.Contravariant
300++#endif
301+ import Data.Functor.Identity
302+
303+ import Control.Applicative
304+@@ -253,6 +256,13 @@
305+ liftIO = lift . liftIO
306+ {-# INLINE liftIO #-}
307+
308++#if MIN_VERSION_base(4,12,0)
309++instance Contravariant m => Contravariant (StateT s m) where
310++ contramap f m = StateT $ \s ->
311++ contramap (\ ~(a, s') -> (f a, s')) $ runStateT m s
312++ {-# INLINE contramap #-}
313++#endif
314++
315+ -- | Fetch the current value of the state within the monad.
316+ get :: (Monad m) => StateT s m s
317+ get = state $ \ s -> (s, s)
318+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs
319+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs 2017-10-04 23:58:48.000000000 +0800
320++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs 2001-09-09 09:46:40.000000000 +0800
321+@@ -73,6 +73,9 @@
322+ import Control.Monad.IO.Class
323+ import Control.Monad.Signatures
324+ import Control.Monad.Trans.Class
325++#if MIN_VERSION_base(4,12,0)
326++import Data.Functor.Contravariant
327++#endif
328+ import Data.Functor.Identity
329+
330+ import Control.Applicative
331+@@ -250,6 +253,13 @@
332+ liftIO = lift . liftIO
333+ {-# INLINE liftIO #-}
334+
335++#if MIN_VERSION_base(4,12,0)
336++instance Contravariant m => Contravariant (StateT s m) where
337++ contramap f m = StateT $ \s ->
338++ contramap (\ (a, s') -> (f a, s')) $ runStateT m s
339++ {-# INLINE contramap #-}
340++#endif
341++
342+ -- | Fetch the current value of the state within the monad.
343+ get :: (Monad m) => StateT s m s
344+ get = state $ \ s -> (s, s)
345+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs
346+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
347++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
348+@@ -52,6 +52,9 @@
349+ import Control.Monad.IO.Class
350+ import Control.Monad.Trans.Class
351+ import Data.Functor.Classes
352++#if MIN_VERSION_base(4,12,0)
353++import Data.Functor.Contravariant
354++#endif
355+ import Data.Functor.Identity
356+
357+ import Control.Applicative
358+@@ -237,6 +240,12 @@
359+ {-# INLINE mzipWith #-}
360+ #endif
361+
362++#if MIN_VERSION_base(4,12,0)
363++instance Contravariant m => Contravariant (WriterT w m) where
364++ contramap f = mapWriterT $ contramap $ \ ~(a, w) -> (f a, w)
365++ {-# INLINE contramap #-}
366++#endif
367++
368+ -- | @'tell' w@ is an action that produces the output @w@.
369+ tell :: (Monad m) => w -> WriterT w m ()
370+ tell w = writer ((), w)
371+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs
372+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs 2017-10-04 23:58:48.000000000 +0800
373++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs 2001-09-09 09:46:40.000000000 +0800
374+@@ -55,6 +55,9 @@
375+ import Control.Monad.IO.Class
376+ import Control.Monad.Trans.Class
377+ import Data.Functor.Classes
378++#if MIN_VERSION_base(4,12,0)
379++import Data.Functor.Contravariant
380++#endif
381+ import Data.Functor.Identity
382+
383+ import Control.Applicative
384+@@ -240,6 +243,12 @@
385+ {-# INLINE mzipWith #-}
386+ #endif
387+
388++#if MIN_VERSION_base(4,12,0)
389++instance Contravariant m => Contravariant (WriterT w m) where
390++ contramap f = mapWriterT $ contramap $ \ (a, w) -> (f a, w)
391++ {-# INLINE contramap #-}
392++#endif
393++
394+ -- | @'tell' w@ is an action that produces the output @w@.
395+ tell :: (Monad m) => w -> WriterT w m ()
396+ tell w = writer ((), w)
397+diff -ur hackage-package-transformers-0.5.5.0/Data/Functor/Constant.hs ghc-package-transformers-0.5.5.0/Data/Functor/Constant.hs
398+--- hackage-package-transformers-0.5.5.0/Data/Functor/Constant.hs 2017-10-04 23:58:48.000000000 +0800
399++++ ghc-package-transformers-0.5.5.0/Data/Functor/Constant.hs 2001-09-09 09:46:40.000000000 +0800
400+@@ -26,6 +26,9 @@
401+ ) where
402+
403+ import Data.Functor.Classes
404++#if MIN_VERSION_base(4,12,0)
405++import Data.Functor.Contravariant
406++#endif
407+
408+ import Control.Applicative
409+ import Data.Foldable
410+@@ -141,3 +144,9 @@
411+ bitraverse f _ (Constant a) = Constant <$> f a
412+ {-# INLINE bitraverse #-}
413+ #endif
414++
415++#if MIN_VERSION_base(4,12,0)
416++instance Contravariant (Constant a) where
417++ contramap _ (Constant a) = Constant a
418++ {-# INLINE contramap #-}
419++#endif
420+diff -ur hackage-package-transformers-0.5.5.0/Data/Functor/Reverse.hs ghc-package-transformers-0.5.5.0/Data/Functor/Reverse.hs
421+--- hackage-package-transformers-0.5.5.0/Data/Functor/Reverse.hs 2017-10-04 23:58:48.000000000 +0800
422++++ ghc-package-transformers-0.5.5.0/Data/Functor/Reverse.hs 2001-09-09 09:46:40.000000000 +0800
423+@@ -28,6 +28,9 @@
424+
425+ import Control.Applicative.Backwards
426+ import Data.Functor.Classes
427++#if MIN_VERSION_base(4,12,0)
428++import Data.Functor.Contravariant
429++#endif
430+
431+ import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
432+ import Control.Applicative
433+@@ -129,3 +132,10 @@
434+ traverse f (Reverse t) =
435+ fmap Reverse . forwards $ traverse (Backwards . f) t
436+ {-# INLINE traverse #-}
437++
438++#if MIN_VERSION_base(4,12,0)
439++-- | Derived instance.
440++instance Contravariant f => Contravariant (Reverse f) where
441++ contramap f = Reverse . contramap f . getReverse
442++ {-# INLINE contramap #-}
443++#endif
444+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs
445+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs 2017-10-04 23:58:48.000000000 +0800
446++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs 2001-09-09 09:46:40.000000000 +0800
447+@@ -35,6 +35,9 @@
448+ ) where
449+
450+ import Data.Functor.Classes
451++#if MIN_VERSION_base(4,12,0)
452++import Data.Functor.Contravariant
453++#endif
454+
455+ import Control.Applicative
456+ #if __GLASGOW_HASKELL__ >= 708
457+@@ -144,3 +147,8 @@
458+ instance (Alternative f, Applicative g) => Alternative (Compose f g) where
459+ empty = Compose empty
460+ Compose x <|> Compose y = Compose (x <|> y)
461++
462++#if MIN_VERSION_base(4,12,0)
463++instance (Functor f, Contravariant g) => Contravariant (Compose f g) where
464++ contramap f (Compose fga) = Compose (fmap (contramap f) fga)
465++#endif
466+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs
467+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs 2017-10-04 23:58:48.000000000 +0800
468++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs 2001-09-09 09:46:40.000000000 +0800
469+@@ -45,6 +45,9 @@
470+ #endif
471+ import Data.Foldable (Foldable(foldMap))
472+ import Data.Functor.Classes
473++#if MIN_VERSION_base(4,12,0)
474++import Data.Functor.Contravariant
475++#endif
476+ import Data.Monoid (mappend)
477+ import Data.Traversable (Traversable(traverse))
478+ #if __GLASGOW_HASKELL__ >= 702
479+@@ -146,3 +149,8 @@
480+ instance (MonadZip f, MonadZip g) => MonadZip (Product f g) where
481+ mzipWith f (Pair x1 y1) (Pair x2 y2) = Pair (mzipWith f x1 x2) (mzipWith f y1 y2)
482+ #endif
483++
484++#if MIN_VERSION_base(4,12,0)
485++instance (Contravariant f, Contravariant g) => Contravariant (Product f g) where
486++ contramap f (Pair a b) = Pair (contramap f a) (contramap f b)
487++#endif
488+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs
489+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs 2017-10-04 23:58:48.000000000 +0800
490++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs 2001-09-09 09:46:40.000000000 +0800
491+@@ -40,6 +40,9 @@
492+ #endif
493+ import Data.Foldable (Foldable(foldMap))
494+ import Data.Functor.Classes
495++#if MIN_VERSION_base(4,12,0)
496++import Data.Functor.Contravariant
497++#endif
498+ import Data.Monoid (mappend)
499+ import Data.Traversable (Traversable(traverse))
500+ #if __GLASGOW_HASKELL__ >= 702
501+@@ -125,3 +128,9 @@
502+ instance (Traversable f, Traversable g) => Traversable (Sum f g) where
503+ traverse f (InL x) = InL <$> traverse f x
504+ traverse f (InR y) = InR <$> traverse f y
505++
506++#if MIN_VERSION_base(4,12,0)
507++instance (Contravariant f, Contravariant g) => Contravariant (Sum f g) where
508++ contramap f (InL xs) = InL (contramap f xs)
509++ contramap f (InR ys) = InR (contramap f ys)
510++#endif
511+diff -ur hackage-package-transformers-0.5.5.0/transformers.cabal ghc-package-transformers-0.5.5.0/transformers.cabal
512+--- hackage-package-transformers-0.5.5.0/transformers.cabal 2017-10-04 23:58:48.000000000 +0800
513++++ ghc-package-transformers-0.5.5.0/transformers.cabal 2001-09-09 09:46:40.000000000 +0800
514+@@ -9,7 +9,9 @@
515+ synopsis: Concrete functor and monad transformers
516+ description:
517+ A portable library of functor and monad transformers, inspired by
518+- the paper \"Functional Programming with Overloading and Higher-Order
519++ the paper
520++ .
521++ * \"Functional Programming with Overloading and Higher-Order
522+ Polymorphism\", by Mark P Jones,
523+ in /Advanced School of Functional Programming/, 1995
524+ (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>).
patches/ghc861/unix-2.7.2.2.patchnew file+109
@@ -0,0 +1,109 @@
1+diff -ur hackage-package-unix-2.7.2.2/configure ghc-package-unix-2.7.2.2/configure
2+--- hackage-package-unix-2.7.2.2/configure 2017-07-20 06:04:36.000000000 +0800
3++++ ghc-package-unix-2.7.2.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -667,7 +667,6 @@
5+ docdir
6+ oldincludedir
7+ includedir
8+-runstatedir
9+ localstatedir
10+ sharedstatedir
11+ sysconfdir
12+@@ -739,7 +738,6 @@
13+ sysconfdir='${prefix}/etc'
14+ sharedstatedir='${prefix}/com'
15+ localstatedir='${prefix}/var'
16+-runstatedir='${localstatedir}/run'
17+ includedir='${prefix}/include'
18+ oldincludedir='/usr/include'
19+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
20+@@ -992,15 +990,6 @@
21+ | -silent | --silent | --silen | --sile | --sil)
22+ silent=yes ;;
23+
24+- -runstatedir | --runstatedir | --runstatedi | --runstated \
25+- | --runstate | --runstat | --runsta | --runst | --runs \
26+- | --run | --ru | --r)
27+- ac_prev=runstatedir ;;
28+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
29+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
30+- | --run=* | --ru=* | --r=*)
31+- runstatedir=$ac_optarg ;;
32+-
33+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
34+ ac_prev=sbindir ;;
35+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
36+@@ -1138,7 +1127,7 @@
37+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
38+ datadir sysconfdir sharedstatedir localstatedir includedir \
39+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
40+- libdir localedir mandir runstatedir
41++ libdir localedir mandir
42+ do
43+ eval ac_val=\$$ac_var
44+ # Remove trailing slashes.
45+@@ -1291,7 +1280,6 @@
46+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
47+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
48+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
49+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
50+ --libdir=DIR object code libraries [EPREFIX/lib]
51+ --includedir=DIR C header files [PREFIX/include]
52+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
53+@@ -3782,7 +3770,7 @@
54+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
55+ since some C++ compilers masquerading as C compilers
56+ incorrectly reject 9223372036854775807. */
57+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
58++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
59+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
60+ && LARGE_OFF_T % 2147483647 == 1)
61+ ? 1 : -1];
62+@@ -3828,7 +3816,7 @@
63+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
64+ since some C++ compilers masquerading as C compilers
65+ incorrectly reject 9223372036854775807. */
66+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
67++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
68+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
69+ && LARGE_OFF_T % 2147483647 == 1)
70+ ? 1 : -1];
71+@@ -3852,7 +3840,7 @@
72+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
73+ since some C++ compilers masquerading as C compilers
74+ incorrectly reject 9223372036854775807. */
75+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
76++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
77+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
78+ && LARGE_OFF_T % 2147483647 == 1)
79+ ? 1 : -1];
80+@@ -3897,7 +3885,7 @@
81+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
82+ since some C++ compilers masquerading as C compilers
83+ incorrectly reject 9223372036854775807. */
84+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
85++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
86+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
87+ && LARGE_OFF_T % 2147483647 == 1)
88+ ? 1 : -1];
89+@@ -3921,7 +3909,7 @@
90+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
91+ since some C++ compilers masquerading as C compilers
92+ incorrectly reject 9223372036854775807. */
93+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
94++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
95+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
96+ && LARGE_OFF_T % 2147483647 == 1)
97+ ? 1 : -1];
98+diff -ur hackage-package-unix-2.7.2.2/unix.cabal ghc-package-unix-2.7.2.2/unix.cabal
99+--- hackage-package-unix-2.7.2.2/unix.cabal 2017-07-20 06:04:36.000000000 +0800
100++++ ghc-package-unix-2.7.2.2/unix.cabal 2001-09-09 09:46:40.000000000 +0800
101+@@ -62,7 +62,7 @@
102+ buildable: False
103+
104+ build-depends:
105+- base >= 4.5 && < 4.11,
106++ base >= 4.5 && < 4.13,
107+ bytestring >= 0.9.2 && < 0.11,
108+ time >= 1.2 && < 1.9
109+
patches/ghc862/binary-0.8.6.0.patchnew file+19
@@ -0,0 +1,19 @@
1+diff -ur hackage-package-binary-0.8.6.0/binary.cabal ghc-package-binary-0.8.6.0/binary.cabal
2+--- hackage-package-binary-0.8.6.0/binary.cabal 2018-08-04 20:33:08.000000000 +0800
3++++ ghc-package-binary-0.8.6.0/binary.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -158,7 +158,6 @@
5+ Data.Binary.Class
6+ Data.Binary.FloatCast
7+ Data.Binary.Generic
8+- Data.Binary.Get
9+ Data.Binary.Get.Internal
10+ Data.Binary.Internal
11+ Data.Binary.Put
12+@@ -191,7 +190,6 @@
13+ Data.Binary.Get
14+ Data.Binary.Get.Internal
15+ Data.Binary.Internal
16+- Data.Binary.Put
17+ build-depends:
18+ base >= 4.5.0.0 && < 5,
19+ bytestring >= 0.10.4,
patches/ghc862/containers-0.6.0.1.patchnew file+1
@@ -0,0 +1 @@
1+Only in hackage-package-containers-0.6.0.1/tests: graph-properties.hs
patches/ghc862/default.nixnew file+11
@@ -0,0 +1,11 @@
1+{
2+ packages.binary.patches = [ ./binary-0.8.6.0.patch ];
3+ packages.containers.patches = [ ./containers-0.6.0.1.patch ];
4+ packages.default.nix.patches = [ ./default.nix ];
5+ packages.hpc.patches = [ ./hpc-0.6.0.3.patch ];
6+ packages.parsec.patches = [ ./parsec-3.1.13.0.patch ];
7+ packages.process.patches = [ ./process-1.6.3.0.patch ];
8+ packages.time.patches = [ ./time-1.8.0.2.patch ];
9+ packages.transformers.patches = [ ./transformers-0.5.5.0.patch ];
10+ packages.unix.patches = [ ./unix-2.7.2.2.patch ];
11+}
patches/ghc862/hpc-0.6.0.3.patchnew file+17
@@ -0,0 +1,17 @@
1+diff -ur hackage-package-hpc-0.6.0.3/hpc.cabal ghc-package-hpc-0.6.0.3/hpc.cabal
2+--- hackage-package-hpc-0.6.0.3/hpc.cabal 2016-05-04 18:47:19.000000000 +0800
3++++ ghc-package-hpc-0.6.0.3/hpc.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -35,9 +35,9 @@
5+ Trace.Hpc.Reflect
6+
7+ Build-Depends:
8+- base >= 4.4.1 && < 4.10,
9+- containers >= 0.4.1 && < 0.6,
10+- directory >= 1.1 && < 1.3,
11++ base >= 4.4.1 && < 4.13,
12++ containers >= 0.4.1 && < 0.7,
13++ directory >= 1.1 && < 1.4,
14+ filepath >= 1 && < 1.5,
15+- time >= 1.2 && < 1.7
16++ time >= 1.2 && < 1.9
17+ ghc-options: -Wall
patches/ghc862/parsec-3.1.13.0.patchnew file+35
@@ -0,0 +1,35 @@
1+diff -ur hackage-package-parsec-3.1.13.0/parsec.cabal ghc-package-parsec-3.1.13.0/parsec.cabal
2+--- hackage-package-parsec-3.1.13.0/parsec.cabal 2018-02-06 17:13:02.000000000 +0800
3++++ ghc-package-parsec-3.1.13.0/parsec.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -21,18 +21,18 @@
5+ license-file: LICENSE
6+ author: Daan Leijen <daan@microsoft.com>, Paolo Martini <paolo@nemail.it>, Antoine Latter <aslatter@gmail.com>
7+ maintainer: Herbert Valerio Riedel <hvr@gnu.org>
8+-homepage: https://github.com/hvr/parsec
9+-bug-reports: https://github.com/hvr/parsec/issues
10++homepage: https://github.com/haskell/parsec
11++bug-reports: https://github.com/haskell/parsec/issues
12+ category: Parsing
13+
14+ build-type: Simple
15+-tested-with: GHC ==8.4.1 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2
16++tested-with: GHC ==8.6.1 || ==8.4.3 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2 || ==7.4.1
17+
18+ extra-source-files: ChangeLog.md, README.md
19+
20+ source-repository head
21+ type: git
22+- location: https://github.com/hvr/parsec
23++ location: https://github.com/haskell/parsec
24+
25+ library
26+ hs-source-dirs: src
27+@@ -64,7 +64,7 @@
28+ Text.ParserCombinators.Parsec.Token
29+
30+ build-depends:
31+- base >= 4.5.1 && < 4.12,
32++ base >= 4.5.0 && < 4.13,
33+ mtl >= 1.1.1 && < 2.3,
34+ bytestring >= 0.9.2.1 && < 0.11,
35+ text >= 0.11.3 && < 1.3
patches/ghc862/process-1.6.3.0.patchnew file+154
@@ -0,0 +1,154 @@
1+diff -ur hackage-package-process-1.6.3.0/System/Process/Common.hs ghc-package-process-1.6.3.0/System/Process/Common.hs
2+--- hackage-package-process-1.6.3.0/System/Process/Common.hs 2017-03-31 01:02:13.000000000 +0800
3++++ ghc-package-process-1.6.3.0/System/Process/Common.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -44,7 +44,7 @@
5+ import GHC.IO.Handle.Types hiding (ClosedHandle)
6+ import System.IO.Error
7+ import Data.Typeable
8+-import GHC.IO.IOMode
9++import System.IO (IOMode)
10+
11+ -- We do a minimal amount of CPP here to provide uniform data types across
12+ -- Windows and POSIX.
13+diff -ur hackage-package-process-1.6.3.0/System/Process/Windows.hsc ghc-package-process-1.6.3.0/System/Process/Windows.hsc
14+--- hackage-package-process-1.6.3.0/System/Process/Windows.hsc 2017-02-21 21:53:00.000000000 +0800
15++++ ghc-package-process-1.6.3.0/System/Process/Windows.hsc 2001-09-09 09:46:40.000000000 +0800
16+@@ -34,7 +34,7 @@
17+ import GHC.IO.Handle.FD
18+ import GHC.IO.Handle.Types hiding (ClosedHandle)
19+ import System.IO.Error
20+-import GHC.IO.IOMode
21++import System.IO (IOMode(..))
22+
23+ import System.Directory ( doesFileExist )
24+ import System.Environment ( getEnv )
25+@@ -208,7 +208,7 @@
26+ then Just <$> peek p_exitCode
27+ else return Nothing
28+
29+-insertItem :: Eq k => MVar [(k, v)] -> k -> v -> IO ()
30++insertItem :: MVar [(k, v)] -> k -> v -> IO ()
31+ insertItem env_ k v = modifyMVar_ env_ (return . ((k, v):))
32+
33+ getItem :: Eq k => MVar [(k, v)] -> k -> IO v
34+diff -ur hackage-package-process-1.6.3.0/System/Process.hs ghc-package-process-1.6.3.0/System/Process.hs
35+--- hackage-package-process-1.6.3.0/System/Process.hs 2017-12-27 17:35:11.000000000 +0800
36++++ ghc-package-process-1.6.3.0/System/Process.hs 2001-09-09 09:46:40.000000000 +0800
37+@@ -43,6 +43,7 @@
38+ readCreateProcessWithExitCode,
39+ readProcessWithExitCode,
40+ withCreateProcess,
41++ cleanupProcess,
42+
43+ -- ** Related utilities
44+ showCommandForUser,
45+@@ -245,7 +246,12 @@
46+ C.bracketOnError (createProcess_ fun c) cleanupProcess
47+ (\(m_in, m_out, m_err, ph) -> action m_in m_out m_err ph)
48+
49+-
50++-- | Cleans up the process.
51++--
52++-- This function is meant to be invoked from any application level cleanup
53++-- handler. It terminates the process, and closes any 'CreatePipe' 'handle's.
54++--
55++-- @since 1.6.4.0
56+ cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
57+ -> IO ()
58+ cleanupProcess (mb_stdin, mb_stdout, mb_stderr,
59+@@ -728,8 +734,10 @@
60+ -- has indeed terminated, use 'getProcessExitCode'.
61+ --
62+ -- On Unix systems, 'terminateProcess' sends the process the SIGTERM signal.
63+--- On Windows systems, the Win32 @TerminateProcess@ function is called, passing
64+--- an exit code of 1.
65++-- On Windows systems, if `use_process_jobs` is `True` then the Win32 @TerminateJobObject@
66++-- function is called to kill all processes associated with the job and passing the
67++-- exit code of 1 to each of them. Otherwise if `use_process_jobs` is `False` then the
68++-- Win32 @TerminateProcess@ function is called, passing an exit code of 1.
69+ --
70+ -- Note: on Windows, if the process was a shell command created by
71+ -- 'createProcess' with 'shell', or created by 'runCommand' or
72+diff -ur hackage-package-process-1.6.3.0/cbits/runProcess.c ghc-package-process-1.6.3.0/cbits/runProcess.c
73+--- hackage-package-process-1.6.3.0/cbits/runProcess.c 2017-02-06 16:42:31.000000000 +0800
74++++ ghc-package-process-1.6.3.0/cbits/runProcess.c 2001-09-09 09:46:40.000000000 +0800
75+@@ -111,6 +111,18 @@
76+ r = pipe(forkCommunicationFds);
77+ if (r == -1) {
78+ *failed_doing = "runInteractiveProcess: pipe";
79++ if (fdStdIn == -1) {
80++ close(fdStdInput[0]);
81++ close(fdStdInput[1]);
82++ }
83++ if (fdStdOut == -1) {
84++ close(fdStdOutput[0]);
85++ close(fdStdOutput[1]);
86++ }
87++ if (fdStdErr == -1) {
88++ close(fdStdError[0]);
89++ close(fdStdError[1]);
90++ }
91+ return -1;
92+ }
93+
94+diff -ur hackage-package-process-1.6.3.0/changelog.md ghc-package-process-1.6.3.0/changelog.md
95+--- hackage-package-process-1.6.3.0/changelog.md 2018-01-22 10:51:34.000000000 +0800
96++++ ghc-package-process-1.6.3.0/changelog.md 2001-09-09 09:46:40.000000000 +0800
97+@@ -1,5 +1,13 @@
98+ # Changelog for [`process` package](http://hackage.haskell.org/package/process)
99+
100++## Unreleased changes
101++
102++* Bug fix: Don't leak pipes on failure
103++ [#122](https://github.com/haskell/process/issues/122)
104++* Expose `cleanupProcess` from `System.Process`
105++ [#130](https://github.com/haskell/process/pull/130)
106++* Drop support for GHC before 7.10.3
107++
108+ ## 1.6.3.0 *January 2018*
109+
110+ * Added `getPid` and export of platform specific `Pid` type
111+diff -ur hackage-package-process-1.6.3.0/process.cabal ghc-package-process-1.6.3.0/process.cabal
112+--- hackage-package-process-1.6.3.0/process.cabal 2018-01-22 10:52:21.000000000 +0800
113++++ ghc-package-process-1.6.3.0/process.cabal 2001-09-09 09:46:40.000000000 +0800
114+@@ -46,8 +46,9 @@
115+ InterruptibleFFI
116+ RecordWildCards
117+ Trustworthy
118+- if impl(ghc>=7.9)
119+- other-extensions: Safe
120++ Safe
121++ if impl(ghc<7.10.3)
122++ buildable: False
123+
124+ exposed-modules:
125+ System.Cmd
126+@@ -61,7 +62,7 @@
127+ cpp-options: -DWINDOWS
128+ else
129+ other-modules: System.Process.Posix
130+- build-depends: unix >= 2.5 && < 2.8
131++ build-depends: unix >= 2.5 && < 2.9
132+
133+ c-sources:
134+ cbits/runProcess.c
135+@@ -74,7 +75,7 @@
136+
137+ ghc-options: -Wall
138+
139+- build-depends: base >= 4.4 && < 4.12,
140++ build-depends: base >= 4.8.2 && < 4.13,
141+ directory >= 1.1 && < 1.4,
142+ filepath >= 1.2 && < 1.5,
143+ deepseq >= 1.1 && < 1.5
144+@@ -84,7 +85,9 @@
145+ hs-source-dirs: test
146+ main-is: main.hs
147+ type: exitcode-stdio-1.0
148+- build-depends: base
149++ -- Add otherwise redundant bounds on base since GHC's build system runs
150++ -- `cabal check`, which mandates bounds on base.
151++ build-depends: base >= 4 && < 5
152+ , bytestring
153+ , directory
154+ , process
patches/ghc862/time-1.8.0.2.patchnew file+146
@@ -0,0 +1,146 @@
1+diff -ur hackage-package-time-1.8.0.2/configure ghc-package-time-1.8.0.2/configure
2+--- hackage-package-time-1.8.0.2/configure 2016-12-07 03:31:54.000000000 +0800
3++++ ghc-package-time-1.8.0.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,6 +1,6 @@
5+ #! /bin/sh
6+ # Guess values for system-dependent variables and create Makefiles.
7+-# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.
8++# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.0.2.
9+ #
10+ # Report bugs to <ashley@semantic.org>.
11+ #
12+@@ -580,8 +580,8 @@
13+ # Identity of this package.
14+ PACKAGE_NAME='Haskell time package'
15+ PACKAGE_TARNAME='time'
16+-PACKAGE_VERSION='1.8'
17+-PACKAGE_STRING='Haskell time package 1.8'
18++PACKAGE_VERSION='1.8.0.2'
19++PACKAGE_STRING='Haskell time package 1.8.0.2'
20+ PACKAGE_BUGREPORT='ashley@semantic.org'
21+ PACKAGE_URL=''
22+
23+@@ -653,7 +653,6 @@
24+ docdir
25+ oldincludedir
26+ includedir
27+-runstatedir
28+ localstatedir
29+ sharedstatedir
30+ sysconfdir
31+@@ -726,7 +725,6 @@
32+ sysconfdir='${prefix}/etc'
33+ sharedstatedir='${prefix}/com'
34+ localstatedir='${prefix}/var'
35+-runstatedir='${localstatedir}/run'
36+ includedir='${prefix}/include'
37+ oldincludedir='/usr/include'
38+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
39+@@ -979,15 +977,6 @@
40+ | -silent | --silent | --silen | --sile | --sil)
41+ silent=yes ;;
42+
43+- -runstatedir | --runstatedir | --runstatedi | --runstated \
44+- | --runstate | --runstat | --runsta | --runst | --runs \
45+- | --run | --ru | --r)
46+- ac_prev=runstatedir ;;
47+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
48+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
49+- | --run=* | --ru=* | --r=*)
50+- runstatedir=$ac_optarg ;;
51+-
52+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
53+ ac_prev=sbindir ;;
54+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
55+@@ -1125,7 +1114,7 @@
56+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
57+ datadir sysconfdir sharedstatedir localstatedir includedir \
58+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
59+- libdir localedir mandir runstatedir
60++ libdir localedir mandir
61+ do
62+ eval ac_val=\$$ac_var
63+ # Remove trailing slashes.
64+@@ -1238,7 +1227,7 @@
65+ # Omit some internal or obsolete options to make the list less imposing.
66+ # This message is too long to be a string in the A/UX 3.1 sh.
67+ cat <<_ACEOF
68+-\`configure' configures Haskell time package 1.8 to adapt to many kinds of systems.
69++\`configure' configures Haskell time package 1.8.0.2 to adapt to many kinds of systems.
70+
71+ Usage: $0 [OPTION]... [VAR=VALUE]...
72+
73+@@ -1278,7 +1267,6 @@
74+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
75+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
76+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
77+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
78+ --libdir=DIR object code libraries [EPREFIX/lib]
79+ --includedir=DIR C header files [PREFIX/include]
80+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
81+@@ -1300,7 +1288,7 @@
82+
83+ if test -n "$ac_init_help"; then
84+ case $ac_init_help in
85+- short | recursive ) echo "Configuration of Haskell time package 1.8:";;
86++ short | recursive ) echo "Configuration of Haskell time package 1.8.0.2:";;
87+ esac
88+ cat <<\_ACEOF
89+
90+@@ -1386,7 +1374,7 @@
91+ test -n "$ac_init_help" && exit $ac_status
92+ if $ac_init_version; then
93+ cat <<\_ACEOF
94+-Haskell time package configure 1.8
95++Haskell time package configure 1.8.0.2
96+ generated by GNU Autoconf 2.69
97+
98+ Copyright (C) 2012 Free Software Foundation, Inc.
99+@@ -1858,7 +1846,7 @@
100+ This file contains any messages produced by compilers while
101+ running configure, to aid debugging if configure makes a mistake.
102+
103+-It was created by Haskell time package $as_me 1.8, which was
104++It was created by Haskell time package $as_me 1.8.0.2, which was
105+ generated by GNU Autoconf 2.69. Invocation command line was
106+
107+ $ $0 $@
108+@@ -4193,7 +4181,7 @@
109+ # report actual input values of CONFIG_FILES etc. instead of their
110+ # values after options handling.
111+ ac_log="
112+-This file was extended by Haskell time package $as_me 1.8, which was
113++This file was extended by Haskell time package $as_me 1.8.0.2, which was
114+ generated by GNU Autoconf 2.69. Invocation command line was
115+
116+ CONFIG_FILES = $CONFIG_FILES
117+@@ -4246,7 +4234,7 @@
118+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
119+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
120+ ac_cs_version="\\
121+-Haskell time package config.status 1.8
122++Haskell time package config.status 1.8.0.2
123+ configured by $0, generated by GNU Autoconf 2.69,
124+ with options \\"\$ac_cs_config\\"
125+
126+diff -ur hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h
127+--- hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2017-05-13 18:29:46.000000000 +0800
128++++ ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2001-09-09 09:46:40.000000000 +0800
129+@@ -69,7 +69,7 @@
130+ #define PACKAGE_NAME "Haskell time package"
131+
132+ /* Define to the full name and version of this package. */
133+-#define PACKAGE_STRING "Haskell time package 1.8"
134++#define PACKAGE_STRING "Haskell time package 1.8.0.2"
135+
136+ /* Define to the one symbol short name of this package. */
137+ #define PACKAGE_TARNAME "time"
138+@@ -78,7 +78,7 @@
139+ #define PACKAGE_URL ""
140+
141+ /* Define to the version of this package. */
142+-#define PACKAGE_VERSION "1.8"
143++#define PACKAGE_VERSION "1.8.0.2"
144+
145+ /* Define to 1 if you have the ANSI C header files. */
146+ #define STDC_HEADERS 1
patches/ghc862/transformers-0.5.5.0.patchnew file+524
@@ -0,0 +1,524 @@
1+diff -ur hackage-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs ghc-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs
2+--- hackage-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs 2017-10-04 23:58:48.000000000 +0800
3++++ ghc-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -27,6 +27,9 @@
5+ ) where
6+
7+ import Data.Functor.Classes
8++#if MIN_VERSION_base(4,12,0)
9++import Data.Functor.Contravariant
10++#endif
11+
12+ import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
13+ import Control.Applicative
14+@@ -100,3 +103,10 @@
15+ {-# INLINE traverse #-}
16+ sequenceA (Backwards t) = fmap Backwards (sequenceA t)
17+ {-# INLINE sequenceA #-}
18++
19++#if MIN_VERSION_base(4,12,0)
20++-- | Derived instance.
21++instance Contravariant f => Contravariant (Backwards f) where
22++ contramap f = Backwards . contramap f . forwards
23++ {-# INLINE contramap #-}
24++#endif
25+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs
26+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs 2017-10-04 23:58:48.000000000 +0800
27++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs 2001-09-09 09:46:40.000000000 +0800
28+@@ -113,7 +113,13 @@
29+
30+ {- $example1
31+
32+-One might define a parsing monad by adding a state (the 'String' remaining
33++The first example is a parser monad in the style of
34++
35++* \"Monadic parsing in Haskell\", by Graham Hutton and Erik Meijer,
36++/Journal of Functional Programming/ 8(4):437-444, July 1998
37++(<http://www.cs.nott.ac.uk/~pszgmh/bib.html#pearl>).
38++
39++We can define such a parser monad by adding a state (the 'String' remaining
40+ to be parsed) to the @[]@ monad, which provides non-determinism:
41+
42+ > import Control.Monad.Trans.State
43+@@ -189,7 +195,8 @@
44+ {- $example3
45+
46+ This example is a cut-down version of the one in
47+-\"Monad Transformers and Modular Interpreters\",
48++
49++* \"Monad Transformers and Modular Interpreters\",
50+ by Sheng Liang, Paul Hudak and Mark Jones in /POPL'95/
51+ (<http://web.cecs.pdx.edu/~mpj/pubs/modinterp.html>).
52+
53+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs
54+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs 2017-10-04 23:58:48.000000000 +0800
55++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs 2001-09-09 09:46:40.000000000 +0800
56+@@ -58,6 +58,9 @@
57+ import Control.Monad.Signatures
58+ import Control.Monad.Trans.Class
59+ import Data.Functor.Classes
60++#if MIN_VERSION_base(4,12,0)
61++import Data.Functor.Contravariant
62++#endif
63+
64+ import Control.Applicative
65+ import Control.Exception (IOException)
66+@@ -263,6 +266,11 @@
67+ instance (Error e, MonadIO m) => MonadIO (ErrorT e m) where
68+ liftIO = lift . liftIO
69+
70++#if MIN_VERSION_base(4,12,0)
71++instance Contravariant m => Contravariant (ErrorT e m) where
72++ contramap f = ErrorT . contramap (fmap f) . runErrorT
73++#endif
74++
75+ -- | Signal an error value @e@.
76+ --
77+ -- * @'runErrorT' ('throwError' e) = 'return' ('Left' e)@
78+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs
79+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs 2017-10-04 23:58:48.000000000 +0800
80++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs 2001-09-09 09:46:40.000000000 +0800
81+@@ -15,7 +15,7 @@
82+ -- Stability : experimental
83+ -- Portability : portable
84+ --
85+--- This monad transformer extends a monad with the ability throw exceptions.
86++-- This monad transformer extends a monad with the ability to throw exceptions.
87+ --
88+ -- A sequence of actions terminates normally, producing a value,
89+ -- only if none of the actions in the sequence throws an exception.
90+@@ -51,6 +51,9 @@
91+ import Control.Monad.Signatures
92+ import Control.Monad.Trans.Class
93+ import Data.Functor.Classes
94++#if MIN_VERSION_base(4,12,0)
95++import Data.Functor.Contravariant
96++#endif
97+ import Data.Functor.Identity
98+
99+ import Control.Applicative
100+@@ -255,6 +258,12 @@
101+ {-# INLINE mzipWith #-}
102+ #endif
103+
104++#if MIN_VERSION_base(4,12,0)
105++instance Contravariant m => Contravariant (ExceptT e m) where
106++ contramap f = ExceptT . contramap (fmap f) . runExceptT
107++ {-# INLINE contramap #-}
108++#endif
109++
110+ -- | Signal an exception value @e@.
111+ --
112+ -- * @'runExceptT' ('throwE' e) = 'return' ('Left' e)@
113+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs
114+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs 2017-10-04 23:58:48.000000000 +0800
115++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs 2001-09-09 09:46:40.000000000 +0800
116+@@ -36,6 +36,9 @@
117+ import Control.Monad.Signatures
118+ import Control.Monad.Trans.Class (MonadTrans(lift))
119+ import Data.Functor.Classes
120++#if MIN_VERSION_base(4,12,0)
121++import Data.Functor.Contravariant
122++#endif
123+
124+ import Control.Applicative
125+ import Control.Monad (MonadPlus(mzero, mplus))
126+@@ -154,6 +157,12 @@
127+ lift = IdentityT
128+ {-# INLINE lift #-}
129+
130++#if MIN_VERSION_base(4,12,0)
131++instance Contravariant f => Contravariant (IdentityT f) where
132++ contramap f = IdentityT . contramap f . runIdentityT
133++ {-# INLINE contramap #-}
134++#endif
135++
136+ -- | Lift a unary operation to the new monad.
137+ mapIdentityT :: (m a -> n b) -> IdentityT m a -> IdentityT n b
138+ mapIdentityT f = IdentityT . f . runIdentityT
139+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs
140+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs 2017-10-04 23:58:48.000000000 +0800
141++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs 2001-09-09 09:46:40.000000000 +0800
142+@@ -34,12 +34,16 @@
143+ import Control.Monad.Signatures
144+ import Control.Monad.Trans.Class
145+ import Data.Functor.Classes
146++#if MIN_VERSION_base(4,12,0)
147++import Data.Functor.Contravariant
148++#endif
149+
150+ import Control.Applicative
151+ import Control.Monad
152+ #if MIN_VERSION_base(4,9,0)
153+ import qualified Control.Monad.Fail as Fail
154+ #endif
155++import Control.Monad.Fix
156+ #if MIN_VERSION_base(4,4,0)
157+ import Control.Monad.Zip (MonadZip(mzipWith))
158+ #endif
159+@@ -137,6 +141,12 @@
160+ return (a ++ b)
161+ {-# INLINE mplus #-}
162+
163++instance (MonadFix m) => MonadFix (ListT m) where
164++ mfix f = ListT $ mfix (runListT . f . head) >>= \ xs -> case xs of
165++ [] -> pure []
166++ x:_ -> (x:) <$> (runListT . mfix) ((mapListT . fmap) tail . f)
167++ {-# INLINE mfix #-}
168++
169+ instance MonadTrans ListT where
170+ lift m = ListT $ do
171+ a <- m
172+@@ -153,6 +163,12 @@
173+ {-# INLINE mzipWith #-}
174+ #endif
175+
176++#if MIN_VERSION_base(4,12,0)
177++instance Contravariant m => Contravariant (ListT m) where
178++ contramap f = ListT . contramap (fmap f) . runListT
179++ {-# INLINE contramap #-}
180++#endif
181++
182+ -- | Lift a @callCC@ operation to the new monad.
183+ liftCallCC :: CallCC m [a] [b] -> CallCC (ListT m) a b
184+ liftCallCC callCC f = ListT $
185+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs
186+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs 2017-10-04 23:58:48.000000000 +0800
187++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs 2001-09-09 09:46:40.000000000 +0800
188+@@ -45,6 +45,9 @@
189+ import Control.Monad.Trans.Class
190+ import Control.Monad.Trans.Except (ExceptT(..))
191+ import Data.Functor.Classes
192++#if MIN_VERSION_base(4,12,0)
193++import Data.Functor.Contravariant
194++#endif
195+
196+ import Control.Applicative
197+ import Control.Monad (MonadPlus(mzero, mplus), liftM)
198+@@ -202,6 +205,12 @@
199+ {-# INLINE mzipWith #-}
200+ #endif
201+
202++#if MIN_VERSION_base(4,12,0)
203++instance Contravariant m => Contravariant (MaybeT m) where
204++ contramap f = MaybeT . contramap (fmap f) . runMaybeT
205++ {-# INLINE contramap #-}
206++#endif
207++
208+ -- | Lift a @callCC@ operation to the new monad.
209+ liftCallCC :: CallCC m (Maybe a) (Maybe b) -> CallCC (MaybeT m) a b
210+ liftCallCC callCC f =
211+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs
212+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
213++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
214+@@ -63,6 +63,9 @@
215+ import Control.Monad.IO.Class
216+ import Control.Monad.Signatures
217+ import Control.Monad.Trans.Class
218++#if MIN_VERSION_base(4,12,0)
219++import Data.Functor.Contravariant
220++#endif
221+ import Data.Functor.Identity
222+
223+ import Control.Applicative
224+@@ -231,6 +234,13 @@
225+ liftIO = lift . liftIO
226+ {-# INLINE liftIO #-}
227+
228++#if MIN_VERSION_base(4,12,0)
229++instance Contravariant m => Contravariant (RWST r w s m) where
230++ contramap f m = RWST $ \r s ->
231++ contramap (\ ~(a, s', w) -> (f a, s', w)) $ runRWST m r s
232++ {-# INLINE contramap #-}
233++#endif
234++
235+ -- ---------------------------------------------------------------------------
236+ -- Reader operations
237+
238+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs
239+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs 2017-10-04 23:58:48.000000000 +0800
240++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs 2001-09-09 09:46:40.000000000 +0800
241+@@ -63,6 +63,9 @@
242+ import Control.Monad.IO.Class
243+ import Control.Monad.Signatures
244+ import Control.Monad.Trans.Class
245++#if MIN_VERSION_base(4,12,0)
246++import Data.Functor.Contravariant
247++#endif
248+ import Data.Functor.Identity
249+
250+ import Control.Applicative
251+@@ -231,6 +234,13 @@
252+ liftIO = lift . liftIO
253+ {-# INLINE liftIO #-}
254+
255++#if MIN_VERSION_base(4,12,0)
256++instance Contravariant m => Contravariant (RWST r w s m) where
257++ contramap f m = RWST $ \r s ->
258++ contramap (\ (a, s', w) -> (f a, s', w)) $ runRWST m r s
259++ {-# INLINE contramap #-}
260++#endif
261++
262+ -- ---------------------------------------------------------------------------
263+ -- Reader operations
264+
265+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs
266+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs 2017-10-04 23:58:48.000000000 +0800
267++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs 2001-09-09 09:46:40.000000000 +0800
268+@@ -49,6 +49,9 @@
269+ import Control.Monad.IO.Class
270+ import Control.Monad.Signatures
271+ import Control.Monad.Trans.Class
272++#if MIN_VERSION_base(4,12,0)
273++import Data.Functor.Contravariant
274++#endif
275+ import Data.Functor.Identity
276+
277+ import Control.Applicative
278+@@ -207,6 +210,12 @@
279+ {-# INLINE mzipWith #-}
280+ #endif
281+
282++#if MIN_VERSION_base(4,12,0)
283++instance Contravariant m => Contravariant (ReaderT r m) where
284++ contramap f = ReaderT . fmap (contramap f) . runReaderT
285++ {-# INLINE contramap #-}
286++#endif
287++
288+ liftReaderT :: m a -> ReaderT r m a
289+ liftReaderT m = ReaderT (const m)
290+ {-# INLINE liftReaderT #-}
291+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs
292+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
293++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
294+@@ -76,6 +76,9 @@
295+ import Control.Monad.IO.Class
296+ import Control.Monad.Signatures
297+ import Control.Monad.Trans.Class
298++#if MIN_VERSION_base(4,12,0)
299++import Data.Functor.Contravariant
300++#endif
301+ import Data.Functor.Identity
302+
303+ import Control.Applicative
304+@@ -253,6 +256,13 @@
305+ liftIO = lift . liftIO
306+ {-# INLINE liftIO #-}
307+
308++#if MIN_VERSION_base(4,12,0)
309++instance Contravariant m => Contravariant (StateT s m) where
310++ contramap f m = StateT $ \s ->
311++ contramap (\ ~(a, s') -> (f a, s')) $ runStateT m s
312++ {-# INLINE contramap #-}
313++#endif
314++
315+ -- | Fetch the current value of the state within the monad.
316+ get :: (Monad m) => StateT s m s
317+ get = state $ \ s -> (s, s)
318+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs
319+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs 2017-10-04 23:58:48.000000000 +0800
320++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs 2001-09-09 09:46:40.000000000 +0800
321+@@ -73,6 +73,9 @@
322+ import Control.Monad.IO.Class
323+ import Control.Monad.Signatures
324+ import Control.Monad.Trans.Class
325++#if MIN_VERSION_base(4,12,0)
326++import Data.Functor.Contravariant
327++#endif
328+ import Data.Functor.Identity
329+
330+ import Control.Applicative
331+@@ -250,6 +253,13 @@
332+ liftIO = lift . liftIO
333+ {-# INLINE liftIO #-}
334+
335++#if MIN_VERSION_base(4,12,0)
336++instance Contravariant m => Contravariant (StateT s m) where
337++ contramap f m = StateT $ \s ->
338++ contramap (\ (a, s') -> (f a, s')) $ runStateT m s
339++ {-# INLINE contramap #-}
340++#endif
341++
342+ -- | Fetch the current value of the state within the monad.
343+ get :: (Monad m) => StateT s m s
344+ get = state $ \ s -> (s, s)
345+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs
346+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
347++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
348+@@ -52,6 +52,9 @@
349+ import Control.Monad.IO.Class
350+ import Control.Monad.Trans.Class
351+ import Data.Functor.Classes
352++#if MIN_VERSION_base(4,12,0)
353++import Data.Functor.Contravariant
354++#endif
355+ import Data.Functor.Identity
356+
357+ import Control.Applicative
358+@@ -237,6 +240,12 @@
359+ {-# INLINE mzipWith #-}
360+ #endif
361+
362++#if MIN_VERSION_base(4,12,0)
363++instance Contravariant m => Contravariant (WriterT w m) where
364++ contramap f = mapWriterT $ contramap $ \ ~(a, w) -> (f a, w)
365++ {-# INLINE contramap #-}
366++#endif
367++
368+ -- | @'tell' w@ is an action that produces the output @w@.
369+ tell :: (Monad m) => w -> WriterT w m ()
370+ tell w = writer ((), w)
371+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs
372+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs 2017-10-04 23:58:48.000000000 +0800
373++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs 2001-09-09 09:46:40.000000000 +0800
374+@@ -55,6 +55,9 @@
375+ import Control.Monad.IO.Class
376+ import Control.Monad.Trans.Class
377+ import Data.Functor.Classes
378++#if MIN_VERSION_base(4,12,0)
379++import Data.Functor.Contravariant
380++#endif
381+ import Data.Functor.Identity
382+
383+ import Control.Applicative
384+@@ -240,6 +243,12 @@
385+ {-# INLINE mzipWith #-}
386+ #endif
387+
388++#if MIN_VERSION_base(4,12,0)
389++instance Contravariant m => Contravariant (WriterT w m) where
390++ contramap f = mapWriterT $ contramap $ \ (a, w) -> (f a, w)
391++ {-# INLINE contramap #-}
392++#endif
393++
394+ -- | @'tell' w@ is an action that produces the output @w@.
395+ tell :: (Monad m) => w -> WriterT w m ()
396+ tell w = writer ((), w)
397+diff -ur hackage-package-transformers-0.5.5.0/Data/Functor/Constant.hs ghc-package-transformers-0.5.5.0/Data/Functor/Constant.hs
398+--- hackage-package-transformers-0.5.5.0/Data/Functor/Constant.hs 2017-10-04 23:58:48.000000000 +0800
399++++ ghc-package-transformers-0.5.5.0/Data/Functor/Constant.hs 2001-09-09 09:46:40.000000000 +0800
400+@@ -26,6 +26,9 @@
401+ ) where
402+
403+ import Data.Functor.Classes
404++#if MIN_VERSION_base(4,12,0)
405++import Data.Functor.Contravariant
406++#endif
407+
408+ import Control.Applicative
409+ import Data.Foldable
410+@@ -141,3 +144,9 @@
411+ bitraverse f _ (Constant a) = Constant <$> f a
412+ {-# INLINE bitraverse #-}
413+ #endif
414++
415++#if MIN_VERSION_base(4,12,0)
416++instance Contravariant (Constant a) where
417++ contramap _ (Constant a) = Constant a
418++ {-# INLINE contramap #-}
419++#endif
420+diff -ur hackage-package-transformers-0.5.5.0/Data/Functor/Reverse.hs ghc-package-transformers-0.5.5.0/Data/Functor/Reverse.hs
421+--- hackage-package-transformers-0.5.5.0/Data/Functor/Reverse.hs 2017-10-04 23:58:48.000000000 +0800
422++++ ghc-package-transformers-0.5.5.0/Data/Functor/Reverse.hs 2001-09-09 09:46:40.000000000 +0800
423+@@ -28,6 +28,9 @@
424+
425+ import Control.Applicative.Backwards
426+ import Data.Functor.Classes
427++#if MIN_VERSION_base(4,12,0)
428++import Data.Functor.Contravariant
429++#endif
430+
431+ import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
432+ import Control.Applicative
433+@@ -129,3 +132,10 @@
434+ traverse f (Reverse t) =
435+ fmap Reverse . forwards $ traverse (Backwards . f) t
436+ {-# INLINE traverse #-}
437++
438++#if MIN_VERSION_base(4,12,0)
439++-- | Derived instance.
440++instance Contravariant f => Contravariant (Reverse f) where
441++ contramap f = Reverse . contramap f . getReverse
442++ {-# INLINE contramap #-}
443++#endif
444+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs
445+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs 2017-10-04 23:58:48.000000000 +0800
446++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs 2001-09-09 09:46:40.000000000 +0800
447+@@ -35,6 +35,9 @@
448+ ) where
449+
450+ import Data.Functor.Classes
451++#if MIN_VERSION_base(4,12,0)
452++import Data.Functor.Contravariant
453++#endif
454+
455+ import Control.Applicative
456+ #if __GLASGOW_HASKELL__ >= 708
457+@@ -144,3 +147,8 @@
458+ instance (Alternative f, Applicative g) => Alternative (Compose f g) where
459+ empty = Compose empty
460+ Compose x <|> Compose y = Compose (x <|> y)
461++
462++#if MIN_VERSION_base(4,12,0)
463++instance (Functor f, Contravariant g) => Contravariant (Compose f g) where
464++ contramap f (Compose fga) = Compose (fmap (contramap f) fga)
465++#endif
466+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs
467+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs 2017-10-04 23:58:48.000000000 +0800
468++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs 2001-09-09 09:46:40.000000000 +0800
469+@@ -45,6 +45,9 @@
470+ #endif
471+ import Data.Foldable (Foldable(foldMap))
472+ import Data.Functor.Classes
473++#if MIN_VERSION_base(4,12,0)
474++import Data.Functor.Contravariant
475++#endif
476+ import Data.Monoid (mappend)
477+ import Data.Traversable (Traversable(traverse))
478+ #if __GLASGOW_HASKELL__ >= 702
479+@@ -146,3 +149,8 @@
480+ instance (MonadZip f, MonadZip g) => MonadZip (Product f g) where
481+ mzipWith f (Pair x1 y1) (Pair x2 y2) = Pair (mzipWith f x1 x2) (mzipWith f y1 y2)
482+ #endif
483++
484++#if MIN_VERSION_base(4,12,0)
485++instance (Contravariant f, Contravariant g) => Contravariant (Product f g) where
486++ contramap f (Pair a b) = Pair (contramap f a) (contramap f b)
487++#endif
488+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs
489+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs 2017-10-04 23:58:48.000000000 +0800
490++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs 2001-09-09 09:46:40.000000000 +0800
491+@@ -40,6 +40,9 @@
492+ #endif
493+ import Data.Foldable (Foldable(foldMap))
494+ import Data.Functor.Classes
495++#if MIN_VERSION_base(4,12,0)
496++import Data.Functor.Contravariant
497++#endif
498+ import Data.Monoid (mappend)
499+ import Data.Traversable (Traversable(traverse))
500+ #if __GLASGOW_HASKELL__ >= 702
501+@@ -125,3 +128,9 @@
502+ instance (Traversable f, Traversable g) => Traversable (Sum f g) where
503+ traverse f (InL x) = InL <$> traverse f x
504+ traverse f (InR y) = InR <$> traverse f y
505++
506++#if MIN_VERSION_base(4,12,0)
507++instance (Contravariant f, Contravariant g) => Contravariant (Sum f g) where
508++ contramap f (InL xs) = InL (contramap f xs)
509++ contramap f (InR ys) = InR (contramap f ys)
510++#endif
511+diff -ur hackage-package-transformers-0.5.5.0/transformers.cabal ghc-package-transformers-0.5.5.0/transformers.cabal
512+--- hackage-package-transformers-0.5.5.0/transformers.cabal 2017-10-04 23:58:48.000000000 +0800
513++++ ghc-package-transformers-0.5.5.0/transformers.cabal 2001-09-09 09:46:40.000000000 +0800
514+@@ -9,7 +9,9 @@
515+ synopsis: Concrete functor and monad transformers
516+ description:
517+ A portable library of functor and monad transformers, inspired by
518+- the paper \"Functional Programming with Overloading and Higher-Order
519++ the paper
520++ .
521++ * \"Functional Programming with Overloading and Higher-Order
522+ Polymorphism\", by Mark P Jones,
523+ in /Advanced School of Functional Programming/, 1995
524+ (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>).
patches/ghc862/unix-2.7.2.2.patchnew file+109
@@ -0,0 +1,109 @@
1+diff -ur hackage-package-unix-2.7.2.2/configure ghc-package-unix-2.7.2.2/configure
2+--- hackage-package-unix-2.7.2.2/configure 2017-07-20 06:04:36.000000000 +0800
3++++ ghc-package-unix-2.7.2.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -667,7 +667,6 @@
5+ docdir
6+ oldincludedir
7+ includedir
8+-runstatedir
9+ localstatedir
10+ sharedstatedir
11+ sysconfdir
12+@@ -739,7 +738,6 @@
13+ sysconfdir='${prefix}/etc'
14+ sharedstatedir='${prefix}/com'
15+ localstatedir='${prefix}/var'
16+-runstatedir='${localstatedir}/run'
17+ includedir='${prefix}/include'
18+ oldincludedir='/usr/include'
19+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
20+@@ -992,15 +990,6 @@
21+ | -silent | --silent | --silen | --sile | --sil)
22+ silent=yes ;;
23+
24+- -runstatedir | --runstatedir | --runstatedi | --runstated \
25+- | --runstate | --runstat | --runsta | --runst | --runs \
26+- | --run | --ru | --r)
27+- ac_prev=runstatedir ;;
28+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
29+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
30+- | --run=* | --ru=* | --r=*)
31+- runstatedir=$ac_optarg ;;
32+-
33+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
34+ ac_prev=sbindir ;;
35+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
36+@@ -1138,7 +1127,7 @@
37+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
38+ datadir sysconfdir sharedstatedir localstatedir includedir \
39+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
40+- libdir localedir mandir runstatedir
41++ libdir localedir mandir
42+ do
43+ eval ac_val=\$$ac_var
44+ # Remove trailing slashes.
45+@@ -1291,7 +1280,6 @@
46+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
47+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
48+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
49+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
50+ --libdir=DIR object code libraries [EPREFIX/lib]
51+ --includedir=DIR C header files [PREFIX/include]
52+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
53+@@ -3782,7 +3770,7 @@
54+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
55+ since some C++ compilers masquerading as C compilers
56+ incorrectly reject 9223372036854775807. */
57+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
58++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
59+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
60+ && LARGE_OFF_T % 2147483647 == 1)
61+ ? 1 : -1];
62+@@ -3828,7 +3816,7 @@
63+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
64+ since some C++ compilers masquerading as C compilers
65+ incorrectly reject 9223372036854775807. */
66+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
67++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
68+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
69+ && LARGE_OFF_T % 2147483647 == 1)
70+ ? 1 : -1];
71+@@ -3852,7 +3840,7 @@
72+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
73+ since some C++ compilers masquerading as C compilers
74+ incorrectly reject 9223372036854775807. */
75+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
76++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
77+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
78+ && LARGE_OFF_T % 2147483647 == 1)
79+ ? 1 : -1];
80+@@ -3897,7 +3885,7 @@
81+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
82+ since some C++ compilers masquerading as C compilers
83+ incorrectly reject 9223372036854775807. */
84+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
85++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
86+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
87+ && LARGE_OFF_T % 2147483647 == 1)
88+ ? 1 : -1];
89+@@ -3921,7 +3909,7 @@
90+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
91+ since some C++ compilers masquerading as C compilers
92+ incorrectly reject 9223372036854775807. */
93+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
94++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
95+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
96+ && LARGE_OFF_T % 2147483647 == 1)
97+ ? 1 : -1];
98+diff -ur hackage-package-unix-2.7.2.2/unix.cabal ghc-package-unix-2.7.2.2/unix.cabal
99+--- hackage-package-unix-2.7.2.2/unix.cabal 2017-07-20 06:04:36.000000000 +0800
100++++ ghc-package-unix-2.7.2.2/unix.cabal 2001-09-09 09:46:40.000000000 +0800
101+@@ -62,7 +62,7 @@
102+ buildable: False
103+
104+ build-depends:
105+- base >= 4.5 && < 4.11,
106++ base >= 4.5 && < 4.13,
107+ bytestring >= 0.9.2 && < 0.11,
108+ time >= 1.2 && < 1.9
109+
patches/ghc863/binary-0.8.6.0.patchnew file+19
@@ -0,0 +1,19 @@
1+diff -ur hackage-package-binary-0.8.6.0/binary.cabal ghc-package-binary-0.8.6.0/binary.cabal
2+--- hackage-package-binary-0.8.6.0/binary.cabal 2018-08-04 20:33:08.000000000 +0800
3++++ ghc-package-binary-0.8.6.0/binary.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -158,7 +158,6 @@
5+ Data.Binary.Class
6+ Data.Binary.FloatCast
7+ Data.Binary.Generic
8+- Data.Binary.Get
9+ Data.Binary.Get.Internal
10+ Data.Binary.Internal
11+ Data.Binary.Put
12+@@ -191,7 +190,6 @@
13+ Data.Binary.Get
14+ Data.Binary.Get.Internal
15+ Data.Binary.Internal
16+- Data.Binary.Put
17+ build-depends:
18+ base >= 4.5.0.0 && < 5,
19+ bytestring >= 0.10.4,
patches/ghc863/containers-0.6.0.1.patchnew file+1
@@ -0,0 +1 @@
1+Only in hackage-package-containers-0.6.0.1/tests: graph-properties.hs
patches/ghc863/default.nixnew file+11
@@ -0,0 +1,11 @@
1+{
2+ packages.binary.patches = [ ./binary-0.8.6.0.patch ];
3+ packages.containers.patches = [ ./containers-0.6.0.1.patch ];
4+ packages.default.nix.patches = [ ./default.nix ];
5+ packages.hpc.patches = [ ./hpc-0.6.0.3.patch ];
6+ packages.parsec.patches = [ ./parsec-3.1.13.0.patch ];
7+ packages.process.patches = [ ./process-1.6.3.0.patch ];
8+ packages.time.patches = [ ./time-1.8.0.2.patch ];
9+ packages.transformers.patches = [ ./transformers-0.5.5.0.patch ];
10+ packages.unix.patches = [ ./unix-2.7.2.2.patch ];
11+}
patches/ghc863/hpc-0.6.0.3.patchnew file+17
@@ -0,0 +1,17 @@
1+diff -ur hackage-package-hpc-0.6.0.3/hpc.cabal ghc-package-hpc-0.6.0.3/hpc.cabal
2+--- hackage-package-hpc-0.6.0.3/hpc.cabal 2016-05-04 18:47:19.000000000 +0800
3++++ ghc-package-hpc-0.6.0.3/hpc.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -35,9 +35,9 @@
5+ Trace.Hpc.Reflect
6+
7+ Build-Depends:
8+- base >= 4.4.1 && < 4.10,
9+- containers >= 0.4.1 && < 0.6,
10+- directory >= 1.1 && < 1.3,
11++ base >= 4.4.1 && < 4.13,
12++ containers >= 0.4.1 && < 0.7,
13++ directory >= 1.1 && < 1.4,
14+ filepath >= 1 && < 1.5,
15+- time >= 1.2 && < 1.7
16++ time >= 1.2 && < 1.9
17+ ghc-options: -Wall
patches/ghc863/parsec-3.1.13.0.patchnew file+35
@@ -0,0 +1,35 @@
1+diff -ur hackage-package-parsec-3.1.13.0/parsec.cabal ghc-package-parsec-3.1.13.0/parsec.cabal
2+--- hackage-package-parsec-3.1.13.0/parsec.cabal 2018-02-06 17:13:02.000000000 +0800
3++++ ghc-package-parsec-3.1.13.0/parsec.cabal 2001-09-09 09:46:40.000000000 +0800
4+@@ -21,18 +21,18 @@
5+ license-file: LICENSE
6+ author: Daan Leijen <daan@microsoft.com>, Paolo Martini <paolo@nemail.it>, Antoine Latter <aslatter@gmail.com>
7+ maintainer: Herbert Valerio Riedel <hvr@gnu.org>
8+-homepage: https://github.com/hvr/parsec
9+-bug-reports: https://github.com/hvr/parsec/issues
10++homepage: https://github.com/haskell/parsec
11++bug-reports: https://github.com/haskell/parsec/issues
12+ category: Parsing
13+
14+ build-type: Simple
15+-tested-with: GHC ==8.4.1 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2
16++tested-with: GHC ==8.6.1 || ==8.4.3 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2 || ==7.4.1
17+
18+ extra-source-files: ChangeLog.md, README.md
19+
20+ source-repository head
21+ type: git
22+- location: https://github.com/hvr/parsec
23++ location: https://github.com/haskell/parsec
24+
25+ library
26+ hs-source-dirs: src
27+@@ -64,7 +64,7 @@
28+ Text.ParserCombinators.Parsec.Token
29+
30+ build-depends:
31+- base >= 4.5.1 && < 4.12,
32++ base >= 4.5.0 && < 4.13,
33+ mtl >= 1.1.1 && < 2.3,
34+ bytestring >= 0.9.2.1 && < 0.11,
35+ text >= 0.11.3 && < 1.3
patches/ghc863/process-1.6.3.0.patchnew file+154
@@ -0,0 +1,154 @@
1+diff -ur hackage-package-process-1.6.3.0/System/Process/Common.hs ghc-package-process-1.6.3.0/System/Process/Common.hs
2+--- hackage-package-process-1.6.3.0/System/Process/Common.hs 2017-03-31 01:02:13.000000000 +0800
3++++ ghc-package-process-1.6.3.0/System/Process/Common.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -44,7 +44,7 @@
5+ import GHC.IO.Handle.Types hiding (ClosedHandle)
6+ import System.IO.Error
7+ import Data.Typeable
8+-import GHC.IO.IOMode
9++import System.IO (IOMode)
10+
11+ -- We do a minimal amount of CPP here to provide uniform data types across
12+ -- Windows and POSIX.
13+diff -ur hackage-package-process-1.6.3.0/System/Process/Windows.hsc ghc-package-process-1.6.3.0/System/Process/Windows.hsc
14+--- hackage-package-process-1.6.3.0/System/Process/Windows.hsc 2017-02-21 21:53:00.000000000 +0800
15++++ ghc-package-process-1.6.3.0/System/Process/Windows.hsc 2001-09-09 09:46:40.000000000 +0800
16+@@ -34,7 +34,7 @@
17+ import GHC.IO.Handle.FD
18+ import GHC.IO.Handle.Types hiding (ClosedHandle)
19+ import System.IO.Error
20+-import GHC.IO.IOMode
21++import System.IO (IOMode(..))
22+
23+ import System.Directory ( doesFileExist )
24+ import System.Environment ( getEnv )
25+@@ -208,7 +208,7 @@
26+ then Just <$> peek p_exitCode
27+ else return Nothing
28+
29+-insertItem :: Eq k => MVar [(k, v)] -> k -> v -> IO ()
30++insertItem :: MVar [(k, v)] -> k -> v -> IO ()
31+ insertItem env_ k v = modifyMVar_ env_ (return . ((k, v):))
32+
33+ getItem :: Eq k => MVar [(k, v)] -> k -> IO v
34+diff -ur hackage-package-process-1.6.3.0/System/Process.hs ghc-package-process-1.6.3.0/System/Process.hs
35+--- hackage-package-process-1.6.3.0/System/Process.hs 2017-12-27 17:35:11.000000000 +0800
36++++ ghc-package-process-1.6.3.0/System/Process.hs 2001-09-09 09:46:40.000000000 +0800
37+@@ -43,6 +43,7 @@
38+ readCreateProcessWithExitCode,
39+ readProcessWithExitCode,
40+ withCreateProcess,
41++ cleanupProcess,
42+
43+ -- ** Related utilities
44+ showCommandForUser,
45+@@ -245,7 +246,12 @@
46+ C.bracketOnError (createProcess_ fun c) cleanupProcess
47+ (\(m_in, m_out, m_err, ph) -> action m_in m_out m_err ph)
48+
49+-
50++-- | Cleans up the process.
51++--
52++-- This function is meant to be invoked from any application level cleanup
53++-- handler. It terminates the process, and closes any 'CreatePipe' 'handle's.
54++--
55++-- @since 1.6.4.0
56+ cleanupProcess :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
57+ -> IO ()
58+ cleanupProcess (mb_stdin, mb_stdout, mb_stderr,
59+@@ -728,8 +734,10 @@
60+ -- has indeed terminated, use 'getProcessExitCode'.
61+ --
62+ -- On Unix systems, 'terminateProcess' sends the process the SIGTERM signal.
63+--- On Windows systems, the Win32 @TerminateProcess@ function is called, passing
64+--- an exit code of 1.
65++-- On Windows systems, if `use_process_jobs` is `True` then the Win32 @TerminateJobObject@
66++-- function is called to kill all processes associated with the job and passing the
67++-- exit code of 1 to each of them. Otherwise if `use_process_jobs` is `False` then the
68++-- Win32 @TerminateProcess@ function is called, passing an exit code of 1.
69+ --
70+ -- Note: on Windows, if the process was a shell command created by
71+ -- 'createProcess' with 'shell', or created by 'runCommand' or
72+diff -ur hackage-package-process-1.6.3.0/cbits/runProcess.c ghc-package-process-1.6.3.0/cbits/runProcess.c
73+--- hackage-package-process-1.6.3.0/cbits/runProcess.c 2017-02-06 16:42:31.000000000 +0800
74++++ ghc-package-process-1.6.3.0/cbits/runProcess.c 2001-09-09 09:46:40.000000000 +0800
75+@@ -111,6 +111,18 @@
76+ r = pipe(forkCommunicationFds);
77+ if (r == -1) {
78+ *failed_doing = "runInteractiveProcess: pipe";
79++ if (fdStdIn == -1) {
80++ close(fdStdInput[0]);
81++ close(fdStdInput[1]);
82++ }
83++ if (fdStdOut == -1) {
84++ close(fdStdOutput[0]);
85++ close(fdStdOutput[1]);
86++ }
87++ if (fdStdErr == -1) {
88++ close(fdStdError[0]);
89++ close(fdStdError[1]);
90++ }
91+ return -1;
92+ }
93+
94+diff -ur hackage-package-process-1.6.3.0/changelog.md ghc-package-process-1.6.3.0/changelog.md
95+--- hackage-package-process-1.6.3.0/changelog.md 2018-01-22 10:51:34.000000000 +0800
96++++ ghc-package-process-1.6.3.0/changelog.md 2001-09-09 09:46:40.000000000 +0800
97+@@ -1,5 +1,13 @@
98+ # Changelog for [`process` package](http://hackage.haskell.org/package/process)
99+
100++## Unreleased changes
101++
102++* Bug fix: Don't leak pipes on failure
103++ [#122](https://github.com/haskell/process/issues/122)
104++* Expose `cleanupProcess` from `System.Process`
105++ [#130](https://github.com/haskell/process/pull/130)
106++* Drop support for GHC before 7.10.3
107++
108+ ## 1.6.3.0 *January 2018*
109+
110+ * Added `getPid` and export of platform specific `Pid` type
111+diff -ur hackage-package-process-1.6.3.0/process.cabal ghc-package-process-1.6.3.0/process.cabal
112+--- hackage-package-process-1.6.3.0/process.cabal 2018-01-22 10:52:21.000000000 +0800
113++++ ghc-package-process-1.6.3.0/process.cabal 2001-09-09 09:46:40.000000000 +0800
114+@@ -46,8 +46,9 @@
115+ InterruptibleFFI
116+ RecordWildCards
117+ Trustworthy
118+- if impl(ghc>=7.9)
119+- other-extensions: Safe
120++ Safe
121++ if impl(ghc<7.10.3)
122++ buildable: False
123+
124+ exposed-modules:
125+ System.Cmd
126+@@ -61,7 +62,7 @@
127+ cpp-options: -DWINDOWS
128+ else
129+ other-modules: System.Process.Posix
130+- build-depends: unix >= 2.5 && < 2.8
131++ build-depends: unix >= 2.5 && < 2.9
132+
133+ c-sources:
134+ cbits/runProcess.c
135+@@ -74,7 +75,7 @@
136+
137+ ghc-options: -Wall
138+
139+- build-depends: base >= 4.4 && < 4.12,
140++ build-depends: base >= 4.8.2 && < 4.13,
141+ directory >= 1.1 && < 1.4,
142+ filepath >= 1.2 && < 1.5,
143+ deepseq >= 1.1 && < 1.5
144+@@ -84,7 +85,9 @@
145+ hs-source-dirs: test
146+ main-is: main.hs
147+ type: exitcode-stdio-1.0
148+- build-depends: base
149++ -- Add otherwise redundant bounds on base since GHC's build system runs
150++ -- `cabal check`, which mandates bounds on base.
151++ build-depends: base >= 4 && < 5
152+ , bytestring
153+ , directory
154+ , process
patches/ghc863/time-1.8.0.2.patchnew file+146
@@ -0,0 +1,146 @@
1+diff -ur hackage-package-time-1.8.0.2/configure ghc-package-time-1.8.0.2/configure
2+--- hackage-package-time-1.8.0.2/configure 2016-12-07 03:31:54.000000000 +0800
3++++ ghc-package-time-1.8.0.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -1,6 +1,6 @@
5+ #! /bin/sh
6+ # Guess values for system-dependent variables and create Makefiles.
7+-# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.
8++# Generated by GNU Autoconf 2.69 for Haskell time package 1.8.0.2.
9+ #
10+ # Report bugs to <ashley@semantic.org>.
11+ #
12+@@ -580,8 +580,8 @@
13+ # Identity of this package.
14+ PACKAGE_NAME='Haskell time package'
15+ PACKAGE_TARNAME='time'
16+-PACKAGE_VERSION='1.8'
17+-PACKAGE_STRING='Haskell time package 1.8'
18++PACKAGE_VERSION='1.8.0.2'
19++PACKAGE_STRING='Haskell time package 1.8.0.2'
20+ PACKAGE_BUGREPORT='ashley@semantic.org'
21+ PACKAGE_URL=''
22+
23+@@ -653,7 +653,6 @@
24+ docdir
25+ oldincludedir
26+ includedir
27+-runstatedir
28+ localstatedir
29+ sharedstatedir
30+ sysconfdir
31+@@ -726,7 +725,6 @@
32+ sysconfdir='${prefix}/etc'
33+ sharedstatedir='${prefix}/com'
34+ localstatedir='${prefix}/var'
35+-runstatedir='${localstatedir}/run'
36+ includedir='${prefix}/include'
37+ oldincludedir='/usr/include'
38+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
39+@@ -979,15 +977,6 @@
40+ | -silent | --silent | --silen | --sile | --sil)
41+ silent=yes ;;
42+
43+- -runstatedir | --runstatedir | --runstatedi | --runstated \
44+- | --runstate | --runstat | --runsta | --runst | --runs \
45+- | --run | --ru | --r)
46+- ac_prev=runstatedir ;;
47+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
48+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
49+- | --run=* | --ru=* | --r=*)
50+- runstatedir=$ac_optarg ;;
51+-
52+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
53+ ac_prev=sbindir ;;
54+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
55+@@ -1125,7 +1114,7 @@
56+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
57+ datadir sysconfdir sharedstatedir localstatedir includedir \
58+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
59+- libdir localedir mandir runstatedir
60++ libdir localedir mandir
61+ do
62+ eval ac_val=\$$ac_var
63+ # Remove trailing slashes.
64+@@ -1238,7 +1227,7 @@
65+ # Omit some internal or obsolete options to make the list less imposing.
66+ # This message is too long to be a string in the A/UX 3.1 sh.
67+ cat <<_ACEOF
68+-\`configure' configures Haskell time package 1.8 to adapt to many kinds of systems.
69++\`configure' configures Haskell time package 1.8.0.2 to adapt to many kinds of systems.
70+
71+ Usage: $0 [OPTION]... [VAR=VALUE]...
72+
73+@@ -1278,7 +1267,6 @@
74+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
75+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
76+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
77+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
78+ --libdir=DIR object code libraries [EPREFIX/lib]
79+ --includedir=DIR C header files [PREFIX/include]
80+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
81+@@ -1300,7 +1288,7 @@
82+
83+ if test -n "$ac_init_help"; then
84+ case $ac_init_help in
85+- short | recursive ) echo "Configuration of Haskell time package 1.8:";;
86++ short | recursive ) echo "Configuration of Haskell time package 1.8.0.2:";;
87+ esac
88+ cat <<\_ACEOF
89+
90+@@ -1386,7 +1374,7 @@
91+ test -n "$ac_init_help" && exit $ac_status
92+ if $ac_init_version; then
93+ cat <<\_ACEOF
94+-Haskell time package configure 1.8
95++Haskell time package configure 1.8.0.2
96+ generated by GNU Autoconf 2.69
97+
98+ Copyright (C) 2012 Free Software Foundation, Inc.
99+@@ -1858,7 +1846,7 @@
100+ This file contains any messages produced by compilers while
101+ running configure, to aid debugging if configure makes a mistake.
102+
103+-It was created by Haskell time package $as_me 1.8, which was
104++It was created by Haskell time package $as_me 1.8.0.2, which was
105+ generated by GNU Autoconf 2.69. Invocation command line was
106+
107+ $ $0 $@
108+@@ -4193,7 +4181,7 @@
109+ # report actual input values of CONFIG_FILES etc. instead of their
110+ # values after options handling.
111+ ac_log="
112+-This file was extended by Haskell time package $as_me 1.8, which was
113++This file was extended by Haskell time package $as_me 1.8.0.2, which was
114+ generated by GNU Autoconf 2.69. Invocation command line was
115+
116+ CONFIG_FILES = $CONFIG_FILES
117+@@ -4246,7 +4234,7 @@
118+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
119+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
120+ ac_cs_version="\\
121+-Haskell time package config.status 1.8
122++Haskell time package config.status 1.8.0.2
123+ configured by $0, generated by GNU Autoconf 2.69,
124+ with options \\"\$ac_cs_config\\"
125+
126+diff -ur hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h
127+--- hackage-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2017-05-13 18:29:46.000000000 +0800
128++++ ghc-package-time-1.8.0.2/lib/include/HsTimeConfig.h 2001-09-09 09:46:40.000000000 +0800
129+@@ -69,7 +69,7 @@
130+ #define PACKAGE_NAME "Haskell time package"
131+
132+ /* Define to the full name and version of this package. */
133+-#define PACKAGE_STRING "Haskell time package 1.8"
134++#define PACKAGE_STRING "Haskell time package 1.8.0.2"
135+
136+ /* Define to the one symbol short name of this package. */
137+ #define PACKAGE_TARNAME "time"
138+@@ -78,7 +78,7 @@
139+ #define PACKAGE_URL ""
140+
141+ /* Define to the version of this package. */
142+-#define PACKAGE_VERSION "1.8"
143++#define PACKAGE_VERSION "1.8.0.2"
144+
145+ /* Define to 1 if you have the ANSI C header files. */
146+ #define STDC_HEADERS 1
patches/ghc863/transformers-0.5.5.0.patchnew file+524
@@ -0,0 +1,524 @@
1+diff -ur hackage-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs ghc-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs
2+--- hackage-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs 2017-10-04 23:58:48.000000000 +0800
3++++ ghc-package-transformers-0.5.5.0/Control/Applicative/Backwards.hs 2001-09-09 09:46:40.000000000 +0800
4+@@ -27,6 +27,9 @@
5+ ) where
6+
7+ import Data.Functor.Classes
8++#if MIN_VERSION_base(4,12,0)
9++import Data.Functor.Contravariant
10++#endif
11+
12+ import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
13+ import Control.Applicative
14+@@ -100,3 +103,10 @@
15+ {-# INLINE traverse #-}
16+ sequenceA (Backwards t) = fmap Backwards (sequenceA t)
17+ {-# INLINE sequenceA #-}
18++
19++#if MIN_VERSION_base(4,12,0)
20++-- | Derived instance.
21++instance Contravariant f => Contravariant (Backwards f) where
22++ contramap f = Backwards . contramap f . forwards
23++ {-# INLINE contramap #-}
24++#endif
25+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs
26+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs 2017-10-04 23:58:48.000000000 +0800
27++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Class.hs 2001-09-09 09:46:40.000000000 +0800
28+@@ -113,7 +113,13 @@
29+
30+ {- $example1
31+
32+-One might define a parsing monad by adding a state (the 'String' remaining
33++The first example is a parser monad in the style of
34++
35++* \"Monadic parsing in Haskell\", by Graham Hutton and Erik Meijer,
36++/Journal of Functional Programming/ 8(4):437-444, July 1998
37++(<http://www.cs.nott.ac.uk/~pszgmh/bib.html#pearl>).
38++
39++We can define such a parser monad by adding a state (the 'String' remaining
40+ to be parsed) to the @[]@ monad, which provides non-determinism:
41+
42+ > import Control.Monad.Trans.State
43+@@ -189,7 +195,8 @@
44+ {- $example3
45+
46+ This example is a cut-down version of the one in
47+-\"Monad Transformers and Modular Interpreters\",
48++
49++* \"Monad Transformers and Modular Interpreters\",
50+ by Sheng Liang, Paul Hudak and Mark Jones in /POPL'95/
51+ (<http://web.cecs.pdx.edu/~mpj/pubs/modinterp.html>).
52+
53+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs
54+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs 2017-10-04 23:58:48.000000000 +0800
55++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Error.hs 2001-09-09 09:46:40.000000000 +0800
56+@@ -58,6 +58,9 @@
57+ import Control.Monad.Signatures
58+ import Control.Monad.Trans.Class
59+ import Data.Functor.Classes
60++#if MIN_VERSION_base(4,12,0)
61++import Data.Functor.Contravariant
62++#endif
63+
64+ import Control.Applicative
65+ import Control.Exception (IOException)
66+@@ -263,6 +266,11 @@
67+ instance (Error e, MonadIO m) => MonadIO (ErrorT e m) where
68+ liftIO = lift . liftIO
69+
70++#if MIN_VERSION_base(4,12,0)
71++instance Contravariant m => Contravariant (ErrorT e m) where
72++ contramap f = ErrorT . contramap (fmap f) . runErrorT
73++#endif
74++
75+ -- | Signal an error value @e@.
76+ --
77+ -- * @'runErrorT' ('throwError' e) = 'return' ('Left' e)@
78+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs
79+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs 2017-10-04 23:58:48.000000000 +0800
80++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Except.hs 2001-09-09 09:46:40.000000000 +0800
81+@@ -15,7 +15,7 @@
82+ -- Stability : experimental
83+ -- Portability : portable
84+ --
85+--- This monad transformer extends a monad with the ability throw exceptions.
86++-- This monad transformer extends a monad with the ability to throw exceptions.
87+ --
88+ -- A sequence of actions terminates normally, producing a value,
89+ -- only if none of the actions in the sequence throws an exception.
90+@@ -51,6 +51,9 @@
91+ import Control.Monad.Signatures
92+ import Control.Monad.Trans.Class
93+ import Data.Functor.Classes
94++#if MIN_VERSION_base(4,12,0)
95++import Data.Functor.Contravariant
96++#endif
97+ import Data.Functor.Identity
98+
99+ import Control.Applicative
100+@@ -255,6 +258,12 @@
101+ {-# INLINE mzipWith #-}
102+ #endif
103+
104++#if MIN_VERSION_base(4,12,0)
105++instance Contravariant m => Contravariant (ExceptT e m) where
106++ contramap f = ExceptT . contramap (fmap f) . runExceptT
107++ {-# INLINE contramap #-}
108++#endif
109++
110+ -- | Signal an exception value @e@.
111+ --
112+ -- * @'runExceptT' ('throwE' e) = 'return' ('Left' e)@
113+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs
114+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs 2017-10-04 23:58:48.000000000 +0800
115++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Identity.hs 2001-09-09 09:46:40.000000000 +0800
116+@@ -36,6 +36,9 @@
117+ import Control.Monad.Signatures
118+ import Control.Monad.Trans.Class (MonadTrans(lift))
119+ import Data.Functor.Classes
120++#if MIN_VERSION_base(4,12,0)
121++import Data.Functor.Contravariant
122++#endif
123+
124+ import Control.Applicative
125+ import Control.Monad (MonadPlus(mzero, mplus))
126+@@ -154,6 +157,12 @@
127+ lift = IdentityT
128+ {-# INLINE lift #-}
129+
130++#if MIN_VERSION_base(4,12,0)
131++instance Contravariant f => Contravariant (IdentityT f) where
132++ contramap f = IdentityT . contramap f . runIdentityT
133++ {-# INLINE contramap #-}
134++#endif
135++
136+ -- | Lift a unary operation to the new monad.
137+ mapIdentityT :: (m a -> n b) -> IdentityT m a -> IdentityT n b
138+ mapIdentityT f = IdentityT . f . runIdentityT
139+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs
140+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs 2017-10-04 23:58:48.000000000 +0800
141++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/List.hs 2001-09-09 09:46:40.000000000 +0800
142+@@ -34,12 +34,16 @@
143+ import Control.Monad.Signatures
144+ import Control.Monad.Trans.Class
145+ import Data.Functor.Classes
146++#if MIN_VERSION_base(4,12,0)
147++import Data.Functor.Contravariant
148++#endif
149+
150+ import Control.Applicative
151+ import Control.Monad
152+ #if MIN_VERSION_base(4,9,0)
153+ import qualified Control.Monad.Fail as Fail
154+ #endif
155++import Control.Monad.Fix
156+ #if MIN_VERSION_base(4,4,0)
157+ import Control.Monad.Zip (MonadZip(mzipWith))
158+ #endif
159+@@ -137,6 +141,12 @@
160+ return (a ++ b)
161+ {-# INLINE mplus #-}
162+
163++instance (MonadFix m) => MonadFix (ListT m) where
164++ mfix f = ListT $ mfix (runListT . f . head) >>= \ xs -> case xs of
165++ [] -> pure []
166++ x:_ -> (x:) <$> (runListT . mfix) ((mapListT . fmap) tail . f)
167++ {-# INLINE mfix #-}
168++
169+ instance MonadTrans ListT where
170+ lift m = ListT $ do
171+ a <- m
172+@@ -153,6 +163,12 @@
173+ {-# INLINE mzipWith #-}
174+ #endif
175+
176++#if MIN_VERSION_base(4,12,0)
177++instance Contravariant m => Contravariant (ListT m) where
178++ contramap f = ListT . contramap (fmap f) . runListT
179++ {-# INLINE contramap #-}
180++#endif
181++
182+ -- | Lift a @callCC@ operation to the new monad.
183+ liftCallCC :: CallCC m [a] [b] -> CallCC (ListT m) a b
184+ liftCallCC callCC f = ListT $
185+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs
186+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs 2017-10-04 23:58:48.000000000 +0800
187++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Maybe.hs 2001-09-09 09:46:40.000000000 +0800
188+@@ -45,6 +45,9 @@
189+ import Control.Monad.Trans.Class
190+ import Control.Monad.Trans.Except (ExceptT(..))
191+ import Data.Functor.Classes
192++#if MIN_VERSION_base(4,12,0)
193++import Data.Functor.Contravariant
194++#endif
195+
196+ import Control.Applicative
197+ import Control.Monad (MonadPlus(mzero, mplus), liftM)
198+@@ -202,6 +205,12 @@
199+ {-# INLINE mzipWith #-}
200+ #endif
201+
202++#if MIN_VERSION_base(4,12,0)
203++instance Contravariant m => Contravariant (MaybeT m) where
204++ contramap f = MaybeT . contramap (fmap f) . runMaybeT
205++ {-# INLINE contramap #-}
206++#endif
207++
208+ -- | Lift a @callCC@ operation to the new monad.
209+ liftCallCC :: CallCC m (Maybe a) (Maybe b) -> CallCC (MaybeT m) a b
210+ liftCallCC callCC f =
211+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs
212+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
213++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
214+@@ -63,6 +63,9 @@
215+ import Control.Monad.IO.Class
216+ import Control.Monad.Signatures
217+ import Control.Monad.Trans.Class
218++#if MIN_VERSION_base(4,12,0)
219++import Data.Functor.Contravariant
220++#endif
221+ import Data.Functor.Identity
222+
223+ import Control.Applicative
224+@@ -231,6 +234,13 @@
225+ liftIO = lift . liftIO
226+ {-# INLINE liftIO #-}
227+
228++#if MIN_VERSION_base(4,12,0)
229++instance Contravariant m => Contravariant (RWST r w s m) where
230++ contramap f m = RWST $ \r s ->
231++ contramap (\ ~(a, s', w) -> (f a, s', w)) $ runRWST m r s
232++ {-# INLINE contramap #-}
233++#endif
234++
235+ -- ---------------------------------------------------------------------------
236+ -- Reader operations
237+
238+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs
239+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs 2017-10-04 23:58:48.000000000 +0800
240++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/RWS/Strict.hs 2001-09-09 09:46:40.000000000 +0800
241+@@ -63,6 +63,9 @@
242+ import Control.Monad.IO.Class
243+ import Control.Monad.Signatures
244+ import Control.Monad.Trans.Class
245++#if MIN_VERSION_base(4,12,0)
246++import Data.Functor.Contravariant
247++#endif
248+ import Data.Functor.Identity
249+
250+ import Control.Applicative
251+@@ -231,6 +234,13 @@
252+ liftIO = lift . liftIO
253+ {-# INLINE liftIO #-}
254+
255++#if MIN_VERSION_base(4,12,0)
256++instance Contravariant m => Contravariant (RWST r w s m) where
257++ contramap f m = RWST $ \r s ->
258++ contramap (\ (a, s', w) -> (f a, s', w)) $ runRWST m r s
259++ {-# INLINE contramap #-}
260++#endif
261++
262+ -- ---------------------------------------------------------------------------
263+ -- Reader operations
264+
265+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs
266+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs 2017-10-04 23:58:48.000000000 +0800
267++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Reader.hs 2001-09-09 09:46:40.000000000 +0800
268+@@ -49,6 +49,9 @@
269+ import Control.Monad.IO.Class
270+ import Control.Monad.Signatures
271+ import Control.Monad.Trans.Class
272++#if MIN_VERSION_base(4,12,0)
273++import Data.Functor.Contravariant
274++#endif
275+ import Data.Functor.Identity
276+
277+ import Control.Applicative
278+@@ -207,6 +210,12 @@
279+ {-# INLINE mzipWith #-}
280+ #endif
281+
282++#if MIN_VERSION_base(4,12,0)
283++instance Contravariant m => Contravariant (ReaderT r m) where
284++ contramap f = ReaderT . fmap (contramap f) . runReaderT
285++ {-# INLINE contramap #-}
286++#endif
287++
288+ liftReaderT :: m a -> ReaderT r m a
289+ liftReaderT m = ReaderT (const m)
290+ {-# INLINE liftReaderT #-}
291+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs
292+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
293++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
294+@@ -76,6 +76,9 @@
295+ import Control.Monad.IO.Class
296+ import Control.Monad.Signatures
297+ import Control.Monad.Trans.Class
298++#if MIN_VERSION_base(4,12,0)
299++import Data.Functor.Contravariant
300++#endif
301+ import Data.Functor.Identity
302+
303+ import Control.Applicative
304+@@ -253,6 +256,13 @@
305+ liftIO = lift . liftIO
306+ {-# INLINE liftIO #-}
307+
308++#if MIN_VERSION_base(4,12,0)
309++instance Contravariant m => Contravariant (StateT s m) where
310++ contramap f m = StateT $ \s ->
311++ contramap (\ ~(a, s') -> (f a, s')) $ runStateT m s
312++ {-# INLINE contramap #-}
313++#endif
314++
315+ -- | Fetch the current value of the state within the monad.
316+ get :: (Monad m) => StateT s m s
317+ get = state $ \ s -> (s, s)
318+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs
319+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs 2017-10-04 23:58:48.000000000 +0800
320++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/State/Strict.hs 2001-09-09 09:46:40.000000000 +0800
321+@@ -73,6 +73,9 @@
322+ import Control.Monad.IO.Class
323+ import Control.Monad.Signatures
324+ import Control.Monad.Trans.Class
325++#if MIN_VERSION_base(4,12,0)
326++import Data.Functor.Contravariant
327++#endif
328+ import Data.Functor.Identity
329+
330+ import Control.Applicative
331+@@ -250,6 +253,13 @@
332+ liftIO = lift . liftIO
333+ {-# INLINE liftIO #-}
334+
335++#if MIN_VERSION_base(4,12,0)
336++instance Contravariant m => Contravariant (StateT s m) where
337++ contramap f m = StateT $ \s ->
338++ contramap (\ (a, s') -> (f a, s')) $ runStateT m s
339++ {-# INLINE contramap #-}
340++#endif
341++
342+ -- | Fetch the current value of the state within the monad.
343+ get :: (Monad m) => StateT s m s
344+ get = state $ \ s -> (s, s)
345+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs
346+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs 2017-10-04 23:58:48.000000000 +0800
347++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Lazy.hs 2001-09-09 09:46:40.000000000 +0800
348+@@ -52,6 +52,9 @@
349+ import Control.Monad.IO.Class
350+ import Control.Monad.Trans.Class
351+ import Data.Functor.Classes
352++#if MIN_VERSION_base(4,12,0)
353++import Data.Functor.Contravariant
354++#endif
355+ import Data.Functor.Identity
356+
357+ import Control.Applicative
358+@@ -237,6 +240,12 @@
359+ {-# INLINE mzipWith #-}
360+ #endif
361+
362++#if MIN_VERSION_base(4,12,0)
363++instance Contravariant m => Contravariant (WriterT w m) where
364++ contramap f = mapWriterT $ contramap $ \ ~(a, w) -> (f a, w)
365++ {-# INLINE contramap #-}
366++#endif
367++
368+ -- | @'tell' w@ is an action that produces the output @w@.
369+ tell :: (Monad m) => w -> WriterT w m ()
370+ tell w = writer ((), w)
371+diff -ur hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs
372+--- hackage-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs 2017-10-04 23:58:48.000000000 +0800
373++++ ghc-package-transformers-0.5.5.0/Control/Monad/Trans/Writer/Strict.hs 2001-09-09 09:46:40.000000000 +0800
374+@@ -55,6 +55,9 @@
375+ import Control.Monad.IO.Class
376+ import Control.Monad.Trans.Class
377+ import Data.Functor.Classes
378++#if MIN_VERSION_base(4,12,0)
379++import Data.Functor.Contravariant
380++#endif
381+ import Data.Functor.Identity
382+
383+ import Control.Applicative
384+@@ -240,6 +243,12 @@
385+ {-# INLINE mzipWith #-}
386+ #endif
387+
388++#if MIN_VERSION_base(4,12,0)
389++instance Contravariant m => Contravariant (WriterT w m) where
390++ contramap f = mapWriterT $ contramap $ \ (a, w) -> (f a, w)
391++ {-# INLINE contramap #-}
392++#endif
393++
394+ -- | @'tell' w@ is an action that produces the output @w@.
395+ tell :: (Monad m) => w -> WriterT w m ()
396+ tell w = writer ((), w)
397+diff -ur hackage-package-transformers-0.5.5.0/Data/Functor/Constant.hs ghc-package-transformers-0.5.5.0/Data/Functor/Constant.hs
398+--- hackage-package-transformers-0.5.5.0/Data/Functor/Constant.hs 2017-10-04 23:58:48.000000000 +0800
399++++ ghc-package-transformers-0.5.5.0/Data/Functor/Constant.hs 2001-09-09 09:46:40.000000000 +0800
400+@@ -26,6 +26,9 @@
401+ ) where
402+
403+ import Data.Functor.Classes
404++#if MIN_VERSION_base(4,12,0)
405++import Data.Functor.Contravariant
406++#endif
407+
408+ import Control.Applicative
409+ import Data.Foldable
410+@@ -141,3 +144,9 @@
411+ bitraverse f _ (Constant a) = Constant <$> f a
412+ {-# INLINE bitraverse #-}
413+ #endif
414++
415++#if MIN_VERSION_base(4,12,0)
416++instance Contravariant (Constant a) where
417++ contramap _ (Constant a) = Constant a
418++ {-# INLINE contramap #-}
419++#endif
420+diff -ur hackage-package-transformers-0.5.5.0/Data/Functor/Reverse.hs ghc-package-transformers-0.5.5.0/Data/Functor/Reverse.hs
421+--- hackage-package-transformers-0.5.5.0/Data/Functor/Reverse.hs 2017-10-04 23:58:48.000000000 +0800
422++++ ghc-package-transformers-0.5.5.0/Data/Functor/Reverse.hs 2001-09-09 09:46:40.000000000 +0800
423+@@ -28,6 +28,9 @@
424+
425+ import Control.Applicative.Backwards
426+ import Data.Functor.Classes
427++#if MIN_VERSION_base(4,12,0)
428++import Data.Functor.Contravariant
429++#endif
430+
431+ import Prelude hiding (foldr, foldr1, foldl, foldl1, null, length)
432+ import Control.Applicative
433+@@ -129,3 +132,10 @@
434+ traverse f (Reverse t) =
435+ fmap Reverse . forwards $ traverse (Backwards . f) t
436+ {-# INLINE traverse #-}
437++
438++#if MIN_VERSION_base(4,12,0)
439++-- | Derived instance.
440++instance Contravariant f => Contravariant (Reverse f) where
441++ contramap f = Reverse . contramap f . getReverse
442++ {-# INLINE contramap #-}
443++#endif
444+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs
445+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs 2017-10-04 23:58:48.000000000 +0800
446++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Compose.hs 2001-09-09 09:46:40.000000000 +0800
447+@@ -35,6 +35,9 @@
448+ ) where
449+
450+ import Data.Functor.Classes
451++#if MIN_VERSION_base(4,12,0)
452++import Data.Functor.Contravariant
453++#endif
454+
455+ import Control.Applicative
456+ #if __GLASGOW_HASKELL__ >= 708
457+@@ -144,3 +147,8 @@
458+ instance (Alternative f, Applicative g) => Alternative (Compose f g) where
459+ empty = Compose empty
460+ Compose x <|> Compose y = Compose (x <|> y)
461++
462++#if MIN_VERSION_base(4,12,0)
463++instance (Functor f, Contravariant g) => Contravariant (Compose f g) where
464++ contramap f (Compose fga) = Compose (fmap (contramap f) fga)
465++#endif
466+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs
467+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs 2017-10-04 23:58:48.000000000 +0800
468++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Product.hs 2001-09-09 09:46:40.000000000 +0800
469+@@ -45,6 +45,9 @@
470+ #endif
471+ import Data.Foldable (Foldable(foldMap))
472+ import Data.Functor.Classes
473++#if MIN_VERSION_base(4,12,0)
474++import Data.Functor.Contravariant
475++#endif
476+ import Data.Monoid (mappend)
477+ import Data.Traversable (Traversable(traverse))
478+ #if __GLASGOW_HASKELL__ >= 702
479+@@ -146,3 +149,8 @@
480+ instance (MonadZip f, MonadZip g) => MonadZip (Product f g) where
481+ mzipWith f (Pair x1 y1) (Pair x2 y2) = Pair (mzipWith f x1 x2) (mzipWith f y1 y2)
482+ #endif
483++
484++#if MIN_VERSION_base(4,12,0)
485++instance (Contravariant f, Contravariant g) => Contravariant (Product f g) where
486++ contramap f (Pair a b) = Pair (contramap f a) (contramap f b)
487++#endif
488+diff -ur hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs
489+--- hackage-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs 2017-10-04 23:58:48.000000000 +0800
490++++ ghc-package-transformers-0.5.5.0/legacy/pre711/Data/Functor/Sum.hs 2001-09-09 09:46:40.000000000 +0800
491+@@ -40,6 +40,9 @@
492+ #endif
493+ import Data.Foldable (Foldable(foldMap))
494+ import Data.Functor.Classes
495++#if MIN_VERSION_base(4,12,0)
496++import Data.Functor.Contravariant
497++#endif
498+ import Data.Monoid (mappend)
499+ import Data.Traversable (Traversable(traverse))
500+ #if __GLASGOW_HASKELL__ >= 702
501+@@ -125,3 +128,9 @@
502+ instance (Traversable f, Traversable g) => Traversable (Sum f g) where
503+ traverse f (InL x) = InL <$> traverse f x
504+ traverse f (InR y) = InR <$> traverse f y
505++
506++#if MIN_VERSION_base(4,12,0)
507++instance (Contravariant f, Contravariant g) => Contravariant (Sum f g) where
508++ contramap f (InL xs) = InL (contramap f xs)
509++ contramap f (InR ys) = InR (contramap f ys)
510++#endif
511+diff -ur hackage-package-transformers-0.5.5.0/transformers.cabal ghc-package-transformers-0.5.5.0/transformers.cabal
512+--- hackage-package-transformers-0.5.5.0/transformers.cabal 2017-10-04 23:58:48.000000000 +0800
513++++ ghc-package-transformers-0.5.5.0/transformers.cabal 2001-09-09 09:46:40.000000000 +0800
514+@@ -9,7 +9,9 @@
515+ synopsis: Concrete functor and monad transformers
516+ description:
517+ A portable library of functor and monad transformers, inspired by
518+- the paper \"Functional Programming with Overloading and Higher-Order
519++ the paper
520++ .
521++ * \"Functional Programming with Overloading and Higher-Order
522+ Polymorphism\", by Mark P Jones,
523+ in /Advanced School of Functional Programming/, 1995
524+ (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>).
patches/ghc863/unix-2.7.2.2.patchnew file+109
@@ -0,0 +1,109 @@
1+diff -ur hackage-package-unix-2.7.2.2/configure ghc-package-unix-2.7.2.2/configure
2+--- hackage-package-unix-2.7.2.2/configure 2017-07-20 06:04:36.000000000 +0800
3++++ ghc-package-unix-2.7.2.2/configure 2001-09-09 09:46:40.000000000 +0800
4+@@ -667,7 +667,6 @@
5+ docdir
6+ oldincludedir
7+ includedir
8+-runstatedir
9+ localstatedir
10+ sharedstatedir
11+ sysconfdir
12+@@ -739,7 +738,6 @@
13+ sysconfdir='${prefix}/etc'
14+ sharedstatedir='${prefix}/com'
15+ localstatedir='${prefix}/var'
16+-runstatedir='${localstatedir}/run'
17+ includedir='${prefix}/include'
18+ oldincludedir='/usr/include'
19+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
20+@@ -992,15 +990,6 @@
21+ | -silent | --silent | --silen | --sile | --sil)
22+ silent=yes ;;
23+
24+- -runstatedir | --runstatedir | --runstatedi | --runstated \
25+- | --runstate | --runstat | --runsta | --runst | --runs \
26+- | --run | --ru | --r)
27+- ac_prev=runstatedir ;;
28+- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
29+- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
30+- | --run=* | --ru=* | --r=*)
31+- runstatedir=$ac_optarg ;;
32+-
33+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
34+ ac_prev=sbindir ;;
35+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
36+@@ -1138,7 +1127,7 @@
37+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
38+ datadir sysconfdir sharedstatedir localstatedir includedir \
39+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
40+- libdir localedir mandir runstatedir
41++ libdir localedir mandir
42+ do
43+ eval ac_val=\$$ac_var
44+ # Remove trailing slashes.
45+@@ -1291,7 +1280,6 @@
46+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
47+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
48+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
49+- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
50+ --libdir=DIR object code libraries [EPREFIX/lib]
51+ --includedir=DIR C header files [PREFIX/include]
52+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
53+@@ -3782,7 +3770,7 @@
54+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
55+ since some C++ compilers masquerading as C compilers
56+ incorrectly reject 9223372036854775807. */
57+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
58++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
59+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
60+ && LARGE_OFF_T % 2147483647 == 1)
61+ ? 1 : -1];
62+@@ -3828,7 +3816,7 @@
63+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
64+ since some C++ compilers masquerading as C compilers
65+ incorrectly reject 9223372036854775807. */
66+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
67++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
68+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
69+ && LARGE_OFF_T % 2147483647 == 1)
70+ ? 1 : -1];
71+@@ -3852,7 +3840,7 @@
72+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
73+ since some C++ compilers masquerading as C compilers
74+ incorrectly reject 9223372036854775807. */
75+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
76++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
77+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
78+ && LARGE_OFF_T % 2147483647 == 1)
79+ ? 1 : -1];
80+@@ -3897,7 +3885,7 @@
81+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
82+ since some C++ compilers masquerading as C compilers
83+ incorrectly reject 9223372036854775807. */
84+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
85++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
86+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
87+ && LARGE_OFF_T % 2147483647 == 1)
88+ ? 1 : -1];
89+@@ -3921,7 +3909,7 @@
90+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
91+ since some C++ compilers masquerading as C compilers
92+ incorrectly reject 9223372036854775807. */
93+-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
94++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
95+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
96+ && LARGE_OFF_T % 2147483647 == 1)
97+ ? 1 : -1];
98+diff -ur hackage-package-unix-2.7.2.2/unix.cabal ghc-package-unix-2.7.2.2/unix.cabal
99+--- hackage-package-unix-2.7.2.2/unix.cabal 2017-07-20 06:04:36.000000000 +0800
100++++ ghc-package-unix-2.7.2.2/unix.cabal 2001-09-09 09:46:40.000000000 +0800
101+@@ -62,7 +62,7 @@
102+ buildable: False
103+
104+ build-depends:
105+- base >= 4.5 && < 4.11,
106++ base >= 4.5 && < 4.13,
107+ bytestring >= 0.9.2 && < 0.11,
108+ time >= 1.2 && < 1.9
109+