on master help sign in
Make it build for GHC-9.0
commitca29fd279e2347d6c494a7e22576625e054c1422 authorHarendra Kumar <harendra@composewell.com> dateWed 10 Feb 2021, 16:58 (6 years ago) parentc3e5f28
5 files changed+15−8
benchmark/streamly-benchmarks.cabal+1−1 docs/Build.md+3 src/Streamly/Internal/FileSystem/FD.hs+8 streamly.cabal+2−2 test/lib/Streamly/Test/Prelude/Common.hs+1−5
benchmark/streamly-benchmarks.cabal+1−1
@@ -113,7 +113,7 @@ common bench-depends
113113 , containers >= 0.5 && < 0.7
114114 , typed-process >= 0.2.3 && < 0.3
115115 , directory >= 1.2.2 && < 1.4
116− , ghc-prim >= 0.4 && < 0.7
116+ , ghc-prim >= 0.4 && < 0.8
117117
118118 if flag(fusion-plugin) && !impl(ghcjs) && !impl(ghc < 8.6)
119119 build-depends:
docs/Build.md+3
@@ -5,6 +5,9 @@ For best performance use GHC 8.10 or 8.8 along with `fusion-plugin`
55(see below). Benchmarks show that GHC 8.8 has significantly better
66performance than GHC 8.6 in many cases.
77
8+Please do not use GHC 9.0 for sensitive applications, initial
9+evaluations have shown severe perf regressions with GHC 9.0.
10+
811GHC versions 8.6 onwards are fully supported along with `fusion-plugin`.
912`fusion-plugin` is not supported for GHC versions below 8.6.
1013
src/Streamly/Internal/FileSystem/FD.hs+8
@@ -217,7 +217,11 @@ readArrayUpto size (Handle fd) = do
217217 -- ptr <- mallocPlainForeignPtrAlignedBytes size (alignment (undefined :: Word8))
218218 withForeignPtr ptr $ \p -> do
219219 -- n <- hGetBufSome h p size
220+#if MIN_VERSION_base(4,15,0)
221+ n <- RawIO.read fd p 0 size
222+#else
220223 n <- RawIO.read fd p size
224+#endif
221225 -- XXX shrink only if the diff is significant
222226 -- Use unsafeFreezeWithShrink
223227 return $
@@ -235,7 +239,11 @@ writeArray :: Storable a => Handle -> Array a -> IO ()
235239writeArray _ arr | A.length arr == 0 = return ()
236240writeArray (Handle fd) arr = withForeignPtr (aStart arr) $ \p ->
237241 -- RawIO.writeAll fd (castPtr p) aLen
242+#if MIN_VERSION_base(4,15,0)
243+ RawIO.write fd (castPtr p) 0 aLen
244+#else
238245 RawIO.write fd (castPtr p) aLen
246+#endif
239247 {-
240248 -- Experiment to compare "writev" based IO with "write" based IO.
241249 iov <- A.newArray 1
streamly.cabal+2−2
@@ -552,12 +552,12 @@ library
552552 , deepseq >= 1.4.1 && < 1.5
553553 , directory >= 1.2.2 && < 1.4
554554 , exceptions >= 0.8 && < 0.11
555− , ghc-prim >= 0.2 && < 0.7
555+ , ghc-prim >= 0.2 && < 0.8
556556 , mtl >= 2.2 && < 3
557557 , primitive >= 0.5.4 && < 0.8
558558 , transformers >= 0.4 && < 0.6
559559
560− , heaps >= 0.3 && < 0.4
560+ , heaps >= 0.3 && < 0.5
561561
562562 -- concurrency
563563 , atomic-primops >= 0.8 && < 0.9
test/lib/Streamly/Test/Prelude/Common.hs+1−5
@@ -1081,11 +1081,7 @@ transformCombineFromList constr eq listOp t op a b c =
10811081-- transformCombineOpsOrdered work only for ordered stream types i.e. excluding
10821082-- the Async type.
10831083transformCombineOpsCommon
1084− :: (IsStream t, Semigroup (t IO Int)
1085−#if __GLASGOW_HASKELL__ < 806
1086− , Functor (t IO)
1087−#endif
1088− )
1084+ :: (IsStream t, Semigroup (t IO Int) , Functor (t IO))
10891085 => ([Int] -> t IO Int)
10901086 -> String
10911087 -> ([Int] -> [Int] -> Bool)