on master help sign in
Allow base-4.17, ghc-9.4
efa1957Harendra Kumar
benchmark/lib/Streamly/Benchmark/Common/Handle.hs+9
@@ -35,6 +35,9 @@ where
35
35
36import Control.DeepSeq (NFData(rnf))
36import Control.DeepSeq (NFData(rnf))
37import Data.Char (ord, chr)
37import Data.Char (ord, chr)
38+#if MIN_VERSION_base(4,17,0)
39+import Data.Char (generalCategory, GeneralCategory(Space))
40+#endif
38import Data.Word (Word8)
41import Data.Word (Word8)
39import System.Directory (getFileSize)
42import System.Directory (getFileSize)
40import System.Environment (lookupEnv)
43import System.Environment (lookupEnv)
@@ -140,8 +143,10 @@ mkBenchSmall name env action =
140
143
141 useSmallH (RefHandles {smallInH = inh, outputH = outh}) = Handles inh outh
144 useSmallH (RefHandles {smallInH = inh, outputH = outh}) = Handles inh outh
142
145
146+#if !MIN_VERSION_base(4,17,0)
143foreign import ccall unsafe "u_iswspace"
147foreign import ccall unsafe "u_iswspace"
144 iswspace :: Int -> Int
148 iswspace :: Int -> Int
149+#endif
145
150
146-- Code copied from base/Data.Char to INLINE it
151-- Code copied from base/Data.Char to INLINE it
147{-# INLINE isSpace #-}
152{-# INLINE isSpace #-}
@@ -154,7 +159,11 @@ isSpace :: Char -> Bool
154-- so we'll do it like this until there's a way around that.
159-- so we'll do it like this until there's a way around that.
155isSpace c
160isSpace c
156 | uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
161 | uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
162+#if MIN_VERSION_base(4,17,0)
163+ | otherwise = generalCategory c == Space
164+#else
157 | otherwise = iswspace (ord c) /= 0
165 | otherwise = iswspace (ord c) /= 0
166+#endif
158 where
167 where
159 uc = fromIntegral (ord c) :: Word
168 uc = fromIntegral (ord c) :: Word
160
169
benchmark/streamly-benchmarks.cabal+7−4
@@ -120,7 +120,7 @@ common bench-depends
120 -- Core libraries shipped with ghc, the min and max
120 -- Core libraries shipped with ghc, the min and max
121 -- constraints of these libraries should match with
121 -- constraints of these libraries should match with
122 -- the GHC versions we support
122 -- the GHC versions we support
123− base >= 4.9 && < 4.17
123+ base >= 4.9 && < 4.18
124 , deepseq >= 1.4.1 && < 1.5
124 , deepseq >= 1.4.1 && < 1.5
125 , mtl >= 2.2 && < 2.3
125 , mtl >= 2.2 && < 2.3
126
126
@@ -133,7 +133,7 @@ common bench-depends
133 , process >= 1.4 && < 1.7
133 , process >= 1.4 && < 1.7
134 , directory >= 1.2.2 && < 1.4
134 , directory >= 1.2.2 && < 1.4
135 , filepath >= 1.4.1 && < 1.5
135 , filepath >= 1.4.1 && < 1.5
136− , ghc-prim >= 0.4 && < 0.9
136+ , ghc-prim >= 0.4 && < 0.10
137
137
138 if flag(bench-core)
138 if flag(bench-core)
139 build-depends: streamly-core
139 build-depends: streamly-core
@@ -155,9 +155,8 @@ common bench-depends
155 build-depends:
155 build-depends:
156 fusion-plugin >= 0.2 && < 0.3
156 fusion-plugin >= 0.2 && < 0.3
157 if flag(inspection)
157 if flag(inspection)
158− build-depends: template-haskell >= 2.14 && < 2.17
158+ build-depends: template-haskell >= 2.14 && < 2.20
159 , inspection-testing >= 0.4 && < 0.5
159 , inspection-testing >= 0.4 && < 0.5
160− , ghc-prim >= 0.2 && < 0.9
161 -- Array uses a Storable constraint in dev build making several inspection
160 -- Array uses a Storable constraint in dev build making several inspection
162 -- tests fail
161 -- tests fail
163 if flag(dev) && flag(inspection)
162 if flag(dev) && flag(inspection)
@@ -582,6 +581,8 @@ benchmark FileSystem.Handle
582 other-modules:
581 other-modules:
583 Handle.Read
582 Handle.Read
584 , Handle.ReadWrite
583 , Handle.ReadWrite
584+ if flag(limit-build-mem)
585+ ghc-options: +RTS -M1000M -RTS
585 if flag(bench-core)
586 if flag(bench-core)
586 buildable: False
587 buildable: False
587 else
588 else
@@ -596,6 +597,8 @@ benchmark Unicode.Stream
596 type: exitcode-stdio-1.0
597 type: exitcode-stdio-1.0
597 hs-source-dirs: Streamly/Benchmark/Unicode
598 hs-source-dirs: Streamly/Benchmark/Unicode
598 main-is: Stream.hs
599 main-is: Stream.hs
600+ if flag(limit-build-mem)
601+ ghc-options: +RTS -M1000M -RTS
599 if flag(bench-core)
602 if flag(bench-core)
600 buildable: False
603 buildable: False
601 else
604 else
cabal.project.ghc-head+3−1
@@ -24,4 +24,6 @@ active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
24source-repository-package
24source-repository-package
25 type: git
25 type: git
26 location: https://github.com/composewell/fusion-plugin
26 location: https://github.com/composewell/fusion-plugin
27− tag: 5fc7a38c9106e643b5ebde61400d54813a071d7b
27+ tag: 25aa89c97aaaf83209d4282638ef774780061366
28+
29+allow-newer: all
core/streamly-core.cabal+2−2
@@ -341,12 +341,12 @@ library
341 -- packages depending on the "ghc" package (packages
341 -- packages depending on the "ghc" package (packages
342 -- depending on doctest is a common example) can
342 -- depending on doctest is a common example) can
343 -- depend on streamly.
343 -- depend on streamly.
344− base >= 4.9 && < 4.17
344+ base >= 4.9 && < 4.18
345 , containers >= 0.5 && < 0.7
345 , containers >= 0.5 && < 0.7
346 , deepseq >= 1.4.1 && < 1.5
346 , deepseq >= 1.4.1 && < 1.5
347 , directory >= 1.2.2 && < 1.4
347 , directory >= 1.2.2 && < 1.4
348 , exceptions >= 0.8 && < 0.11
348 , exceptions >= 0.8 && < 0.11
349− , ghc-prim >= 0.2 && < 0.9
349+ , ghc-prim >= 0.2 && < 0.10
350 , mtl >= 2.2 && < 2.3
350 , mtl >= 2.2 && < 2.3
351 , transformers >= 0.4 && < 0.7
351 , transformers >= 0.4 && < 0.7
352 , filepath >= 1.2.0.0 && < 1.5
352 , filepath >= 1.2.0.0 && < 1.5
src/Streamly/Internal/Unicode/Stream.hs+9
@@ -85,6 +85,9 @@ import Control.Monad.Catch (MonadThrow(..), MonadCatch)
85import Control.Monad.IO.Class (MonadIO, liftIO)
85import Control.Monad.IO.Class (MonadIO, liftIO)
86import Data.Bits (shiftR, shiftL, (.|.), (.&.))
86import Data.Bits (shiftR, shiftL, (.|.), (.&.))
87import Data.Char (chr, ord)
87import Data.Char (chr, ord)
88+#if MIN_VERSION_base(4,17,0)
89+import Data.Char (generalCategory, GeneralCategory(Space))
90+#endif
88import Data.Word (Word8)
91import Data.Word (Word8)
89import Foreign.Storable (Storable(..))
92import Foreign.Storable (Storable(..))
90import Fusion.Plugin.Types (Fuse(..))
93import Fusion.Plugin.Types (Fuse(..))
@@ -1036,15 +1039,21 @@ stripHead = S.dropWhile isSpace
1036lines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
1039lines :: (Monad m, IsStream t) => Fold m Char b -> t m Char -> t m b
1037lines = S.splitOnSuffix (== '\n')
1040lines = S.splitOnSuffix (== '\n')
1038
1041
1042+#if !MIN_VERSION_base(4,17,0)
1039foreign import ccall unsafe "u_iswspace"
1043foreign import ccall unsafe "u_iswspace"
1040 iswspace :: Int -> Int
1044 iswspace :: Int -> Int
1045+#endif
1041
1046
1042-- | Code copied from base/Data.Char to INLINE it
1047-- | Code copied from base/Data.Char to INLINE it
1043{-# INLINE isSpace #-}
1048{-# INLINE isSpace #-}
1044isSpace :: Char -> Bool
1049isSpace :: Char -> Bool
1045isSpace c
1050isSpace c
1046 | uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
1051 | uc <= 0x377 = uc == 32 || uc - 0x9 <= 4 || uc == 0xa0
1052+#if MIN_VERSION_base(4,17,0)
1053+ | otherwise = generalCategory c == Space
1054+#else
1047 | otherwise = iswspace (ord c) /= 0
1055 | otherwise = iswspace (ord c) /= 0
1056+#endif
1048 where
1057 where
1049 uc = fromIntegral (ord c) :: Word
1058 uc = fromIntegral (ord c) :: Word
1050
1059
streamly.cabal+4−5
@@ -679,16 +679,16 @@ library
679 -- packages depending on the "ghc" package (packages
679 -- packages depending on the "ghc" package (packages
680 -- depending on doctest is a common example) can
680 -- depending on doctest is a common example) can
681 -- depend on streamly.
681 -- depend on streamly.
682− base >= 4.9 && < 4.17
682+ base >= 4.9 && < 4.18
683 , containers >= 0.5 && < 0.7
683 , containers >= 0.5 && < 0.7
684 , deepseq >= 1.4.1 && < 1.5
684 , deepseq >= 1.4.1 && < 1.5
685 , directory >= 1.2.2 && < 1.4
685 , directory >= 1.2.2 && < 1.4
686 , exceptions >= 0.8 && < 0.11
686 , exceptions >= 0.8 && < 0.11
687− , ghc-prim >= 0.2 && < 0.9
687+ , ghc-prim >= 0.2 && < 0.10
688 , mtl >= 2.2 && < 2.3
688 , mtl >= 2.2 && < 2.3
689 , transformers >= 0.4 && < 0.7
689 , transformers >= 0.4 && < 0.7
690 , filepath >= 1.2.0.0 && < 1.5
690 , filepath >= 1.2.0.0 && < 1.5
691− , template-haskell >= 2.13 && < 2.19
691+ , template-haskell >= 2.13 && < 2.20
692
692
693 -- The core streamly package
693 -- The core streamly package
694 , streamly-core == 0.1.0
694 , streamly-core == 0.1.0
@@ -716,8 +716,7 @@ library
716 frameworks: Cocoa
716 frameworks: Cocoa
717
717
718 if flag(inspection)
718 if flag(inspection)
719− build-depends: template-haskell >= 2.14 && < 2.17
720− , inspection-testing >= 0.4 && < 0.5
719+ build-depends: inspection-testing >= 0.4 && < 0.5
721
720
722 -- Array uses a Storable constraint in dev build making several inspection
721 -- Array uses a Storable constraint in dev build making several inspection
723 -- tests fail
722 -- tests fail