on master help sign in
Remove support for GHC 8.4.*
commit09ed99de1fdcf2d0b1b8fad7b389bd893948eff7 authorAdithya Kumar <adithya@composewell.com> dateWed 28 Sep 2022, 15:21 (4 years ago) parent4e4c194
12 files changed+11−193
.circleci/config.yml+2−2 .github/workflows/haskell.yml−7 core/src/Streamly/Internal/Data/Unboxed.hs−122 docs/User/ProjectRelated/Changelog.md+1 src/Streamly/Internal/Data/SVar/Dispatch.hs−3 src/Streamly/Internal/Data/Stream/Async/Channel/Dispatcher.hs−3 src/Streamly/Internal/Data/Stream/IsStream/Type.hs−2 src/Streamly/Internal/FileSystem/FDIO.hs−5 streamly.cabal+1−2 test/Streamly/Test/Data/Unfold.hs−6 test/Streamly/Test/Prelude/Serial.hs−2 test/lib/Streamly/Test/Prelude/Common.hs+7−39
.circleci/config.yml+2−2
@@ -409,8 +409,8 @@ workflows:
409409 #- cabal-ghc-8_0_2:
410410 # name: GHC 8.0.2 + no-test + no-bench + no-docs
411411 #- cabal-ghc-7.10.3
412− - cabal-ghcjs-8_4:
413− name: GHCJS 8.4 + no-test + no-docs
412+ # - cabal-ghcjs-8_4:
413+ # name: GHCJS 8.4 + no-test + no-docs
414414 #- stack-ghc-8.4
415415 #- stack-ghc-8.2
416416 #- coveralls-ghc-8.2.2
.github/workflows/haskell.yml−7
@@ -157,13 +157,6 @@ jobs:
157157 cabal_project: cabal.project
158158 cabal_build_options: "--flag debug --flag -opt"
159159 ignore_error: false
160− - name: 8.4.4-sdist
161− ghc_version: 8.4.4
162− runner: ubuntu-latest
163− build: cabal
164− cabal_version: 3.6.2.0
165− cabal_project: cabal.project
166− ignore_error: false
167160
168161 steps:
169162 - uses: actions/checkout@v2
core/src/Streamly/Internal/Data/Unboxed.hs−122
@@ -113,128 +113,6 @@ unpin arr@(MutableByteArray marr#) =
113113-- The Unboxed type class
114114--------------------------------------------------------------------------------
115115
116−#if !MIN_VERSION_base(4,12,0)
117−
118−#define SIZEOF_HSCHAR_PRIMITIVE 4#
119−#define SIZEOF_HSINT_PRIMITIVE 8#
120−#define SIZEOF_HSWORD_PRIMITIVE 8#
121−#define SIZEOF_WORD8_PRIMITIVE 1#
122−#define SIZEOF_WORD32_PRIMITIVE 4#
123−#define SIZEOF_WORD64_PRIMITIVE 8#
124−#define SIZEOF_HSDOUBLE_PRIMITIVE 8#
125−#define SIZEOF_INT32_PRIMITIVE 4#
126−#define SIZEOF_INT64_PRIMITIVE 8#
127−
128−#ifdef __GHCJS__
129−#define WORD64TYP Word64#
130−#else
131−#define WORD64TYP Word#
132−#endif
133−
134−#ifdef __GHCJS__
135−#define INT64TYP Int64#
136−#else
137−#define INT64TYP Int#
138−#endif
139−
140−{-# INLINE readWord8ArrayAsWideChar# #-}
141−readWord8ArrayAsWideChar# ::
142− MutableByteArray# d -> Int# -> State# d -> (# State# d, Char# #)
143−readWord8ArrayAsWideChar# arr# i# =
144− readWideCharArray# arr# (quotInt# i# SIZEOF_HSCHAR_PRIMITIVE)
145−
146−{-# INLINE writeWord8ArrayAsWideChar# #-}
147−writeWord8ArrayAsWideChar# ::
148− MutableByteArray# d -> Int# -> Char# -> State# d -> State# d
149−writeWord8ArrayAsWideChar# arr# i# =
150− writeWideCharArray# arr# (quotInt# i# SIZEOF_HSCHAR_PRIMITIVE)
151−
152−{-# INLINE readWord8ArrayAsInt# #-}
153−readWord8ArrayAsInt# ::
154− MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
155−readWord8ArrayAsInt# arr# i# =
156− readIntArray# arr# (quotInt# i# SIZEOF_HSINT_PRIMITIVE)
157−
158−{-# INLINE writeWord8ArrayAsInt# #-}
159−writeWord8ArrayAsInt# ::
160− MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
161−writeWord8ArrayAsInt# arr# i# =
162− writeIntArray# arr# (quotInt# i# SIZEOF_HSINT_PRIMITIVE)
163−
164−{-# INLINE readWord8ArrayAsInt32# #-}
165−readWord8ArrayAsInt32# ::
166− MutableByteArray# d -> Int# -> State# d -> (# State# d, Int# #)
167−readWord8ArrayAsInt32# arr# i# =
168− readInt32Array# arr# (quotInt# i# SIZEOF_INT32_PRIMITIVE)
169−
170−{-# INLINE writeWord8ArrayAsInt32# #-}
171−writeWord8ArrayAsInt32# ::
172− MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
173−writeWord8ArrayAsInt32# arr# i# =
174− writeInt32Array# arr# (quotInt# i# SIZEOF_INT32_PRIMITIVE)
175−
176−{-# INLINE readWord8ArrayAsInt64# #-}
177−readWord8ArrayAsInt64# ::
178− MutableByteArray# d -> Int# -> State# d -> (# State# d, INT64TYP #)
179−readWord8ArrayAsInt64# arr# i# =
180− readInt64Array# arr# (quotInt# i# SIZEOF_INT64_PRIMITIVE)
181−
182−{-# INLINE writeWord8ArrayAsInt64# #-}
183−writeWord8ArrayAsInt64# ::
184− MutableByteArray# d -> Int# -> INT64TYP -> State# d -> State# d
185−writeWord8ArrayAsInt64# arr# i# =
186− writeInt64Array# arr# (quotInt# i# SIZEOF_INT64_PRIMITIVE)
187−
188−{-# INLINE readWord8ArrayAsWord# #-}
189−readWord8ArrayAsWord# ::
190− MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
191−readWord8ArrayAsWord# arr# i# =
192− readWordArray# arr# (quotInt# i# SIZEOF_HSWORD_PRIMITIVE)
193−
194−{-# INLINE writeWord8ArrayAsWord# #-}
195−writeWord8ArrayAsWord# ::
196− MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
197−writeWord8ArrayAsWord# arr# i# =
198− writeWordArray# arr# (quotInt# i# SIZEOF_HSWORD_PRIMITIVE)
199−
200−{-# INLINE readWord8ArrayAsWord32# #-}
201−readWord8ArrayAsWord32# ::
202− MutableByteArray# d -> Int# -> State# d -> (# State# d, Word# #)
203−readWord8ArrayAsWord32# arr# i# =
204− readWord32Array# arr# (quotInt# i# SIZEOF_WORD32_PRIMITIVE)
205−
206−{-# INLINE writeWord8ArrayAsWord32# #-}
207−writeWord8ArrayAsWord32# ::
208− MutableByteArray# d -> Int# -> Word# -> State# d -> State# d
209−writeWord8ArrayAsWord32# arr# i# =
210− writeWord32Array# arr# (quotInt# i# SIZEOF_WORD32_PRIMITIVE)
211−
212−{-# INLINE readWord8ArrayAsWord64# #-}
213−readWord8ArrayAsWord64# ::
214− MutableByteArray# d -> Int# -> State# d -> (# State# d, WORD64TYP #)
215−readWord8ArrayAsWord64# arr# i# =
216− readWord64Array# arr# (quotInt# i# SIZEOF_WORD64_PRIMITIVE)
217−
218−{-# INLINE writeWord8ArrayAsWord64# #-}
219−writeWord8ArrayAsWord64# ::
220− MutableByteArray# d -> Int# -> WORD64TYP -> State# d -> State# d
221−writeWord8ArrayAsWord64# arr# i# =
222− writeWord64Array# arr# (quotInt# i# SIZEOF_WORD64_PRIMITIVE)
223−
224−{-# INLINE readWord8ArrayAsDouble# #-}
225−readWord8ArrayAsDouble# ::
226− MutableByteArray# d -> Int# -> State# d -> (# State# d, Double# #)
227−readWord8ArrayAsDouble# arr# i# =
228− readDoubleArray# arr# (quotInt# i# SIZEOF_HSDOUBLE_PRIMITIVE)
229−
230−{-# INLINE writeWord8ArrayAsDouble# #-}
231−writeWord8ArrayAsDouble# ::
232− MutableByteArray# d -> Int# -> Double# -> State# d -> State# d
233−writeWord8ArrayAsDouble# arr# i# =
234− writeDoubleArray# arr# (quotInt# i# SIZEOF_HSDOUBLE_PRIMITIVE)
235−
236−#endif
237−
238116-- In theory we could convert a type to and from a byte stream and use that
239117-- to implement boxing, unboxing. But that would be inefficient. This type
240118-- class allows each primitive type to have its own specific efficient
docs/User/ProjectRelated/Changelog.md+1
@@ -3,6 +3,7 @@
33<!-- See rendered changelog at https://streamly.composewell.com -->
44## Unreleased
55
6+* Remove support for GHC 8.4.*
67* The unboxed arrays now require `Unbox` instance along with `Storable` for the
78 stored type. The `Unbox` typeclass can be found in `Streamly.Data.Unbox`.
89* New modules for unboxed mutable & unboxed immutable arrays are added.
src/Streamly/Internal/Data/SVar/Dispatch.hs−3
@@ -46,9 +46,6 @@ import Control.Monad (when, void)
4646import Control.Monad.IO.Class (MonadIO(liftIO))
4747import Data.Maybe (fromJust, fromMaybe)
4848import Data.IORef (IORef, modifyIORef, newIORef, readIORef, writeIORef)
49−#if __GLASGOW_HASKELL__ < 804
50−import Data.Semigroup ((<>))
51−#endif
5249import Streamly.Internal.Control.Concurrent (MonadAsync, askRunInIO)
5350import Streamly.Internal.Control.ForkLifted (doFork)
5451import Streamly.Internal.Data.Atomics
src/Streamly/Internal/Data/Stream/Async/Channel/Dispatcher.hs−3
@@ -44,9 +44,6 @@ import Control.Monad (when, void)
4444import Control.Monad.IO.Class (MonadIO(liftIO))
4545import Data.Maybe (fromJust, fromMaybe)
4646import Data.IORef (IORef, modifyIORef, newIORef, readIORef, writeIORef)
47−#if __GLASGOW_HASKELL__ < 804
48−import Data.Semigroup ((<>))
49−#endif
5047import Streamly.Internal.Control.ForkLifted (doFork)
5148import Streamly.Internal.Data.Atomics
5249 (atomicModifyIORefCAS, atomicModifyIORefCAS_, writeBarrier,
src/Streamly/Internal/Data/Stream/IsStream/Type.hs−2
@@ -152,13 +152,11 @@ infixr 5 |:
152152--
153153-- @since 0.8.0
154154class
155−#if __GLASGOW_HASKELL__ >= 806
156155 ( forall m a. MonadAsync m => Semigroup (t m a)
157156 , forall m a. MonadAsync m => Monoid (t m a)
158157 , forall m. Monad m => Functor (t m)
159158 , forall m. MonadAsync m => Applicative (t m)
160159 ) =>
161−#endif
162160 IsStream t where
163161 toStream :: t m a -> K.Stream m a
164162 fromStream :: K.Stream m a -> t m a
src/Streamly/Internal/FileSystem/FDIO.hs−5
@@ -57,13 +57,8 @@ isNonBlocking fd = fdIsNonBlocking fd /= 0
5757
5858-- "poll"s the fd for data to become available or timeout
5959-- See cbits/inputReady.c in base package
60−#if __GLASGOW_HASKELL__ >= 804
6160foreign import ccall unsafe "fdReady"
6261 unsafe_fdReady :: CInt -> CBool -> Int64 -> CBool -> IO CInt
63−#else
64−foreign import ccall safe "fdReady"
65− unsafe_fdReady :: CInt -> CInt -> CInt -> CInt -> IO CInt
66−#endif
6762
6863writeNonBlocking :: String -> FD -> Ptr Word8 -> Int -> CSize -> IO CInt
6964writeNonBlocking loc !fd !buf !off !len
streamly.cabal+1−2
@@ -31,8 +31,7 @@ homepage: https://streamly.composewell.com
3131bug-reports: https://github.com/composewell/streamly/issues
3232license: BSD-3-Clause
3333license-file: LICENSE
34−tested-with: GHC==8.4.4
35− , GHC==8.6.5
34+tested-with: GHC==8.6.5
3635 , GHC==8.8.4
3736 , GHC==8.10.7
3837 , GHC==9.0.2
test/Streamly/Test/Data/Unfold.hs−6
@@ -410,8 +410,6 @@ enumerateFromThenToSmallUnit =
410410 in testUnfold unf (f :: (), th, to) $
411411 Prelude.take 1 $ Prelude.enumFromThenTo f th to
412412
413−
414−#if MIN_VERSION_base(4,12,0)
415413enumerateFromFractional :: Property
416414enumerateFromFractional =
417415 property
@@ -443,8 +441,6 @@ enumerateFromToFractional =
443441 let unf = UF.enumerateFromToFractional
444442 in testUnfold unf (f :: Double, t) [f..(t :: Double)]
445443
446−#endif
447−
448444-------------------------------------------------------------------------------
449445-- Stream transformation
450446-------------------------------------------------------------------------------
@@ -651,12 +647,10 @@ testGeneration =
651647 prop "enumerateFromToSmallBool" enumerateFromToSmallBool
652648 prop "enumerateFromThenToSmallBool" enumerateFromThenToSmallBool
653649
654−#if MIN_VERSION_base(4,12,0)
655650 prop "enumerateFromFractional" enumerateFromFractional
656651 prop "enumerateFromThenFractional" enumerateFromThenFractional
657652 prop "enumerateFromToFractional" enumerateFromToFractional
658653 prop "enumerateFromThenToFractional" enumerateFromThenToFractional
659−#endif
660654
661655testTransformation :: Spec
662656testTransformation =
test/Streamly/Test/Prelude/Serial.hs−2
@@ -555,10 +555,8 @@ main = hspec
555555 serialOps $ prop "serially replicateM" . constructWithReplicateM
556556 serialOps $ prop "serially intFromThenTo" .
557557 constructWithIntFromThenTo
558−#if __GLASGOW_HASKELL__ >= 806
559558 serialOps $ prop "serially DoubleFromThenTo" .
560559 constructWithDoubleFromThenTo
561−#endif
562560 serialOps $ prop "serially iterate" . constructWithIterate
563561 -- XXX test for all types of streams
564562 serialOps $ prop "serially iterateM" . constructWithIterateM
test/lib/Streamly/Test/Prelude/Common.hs+7−39
@@ -15,9 +15,7 @@ module Streamly.Test.Prelude.Common
1515 , constructWithReplicate
1616 , constructWithReplicateM
1717 , constructWithIntFromThenTo
18−#if __GLASGOW_HASKELL__ >= 806
1918 , constructWithDoubleFromThenTo
20−#endif
2119 , constructWithIterate
2220 , constructWithIterateM
2321 , constructWithEnumerate
@@ -221,7 +219,6 @@ constructWithRepeatM = constructWithLenM stream list
221219 stream n = S.take n $ S.repeatM (return 1)
222220 list n = return $ replicate n 1
223221
224−#if __GLASGOW_HASKELL__ >= 806
225222-- XXX try very small steps close to 0
226223constructWithDoubleFromThenTo
227224 :: IsStream t
@@ -235,7 +232,6 @@ constructWithDoubleFromThenTo op l =
235232 let list len = take len [from,next..to]
236233 stream len = S.take len $ S.enumerateFromThenTo from next to
237234 in constructWithLen stream list op l
238−#endif
239235
240236constructWithIterate ::
241237 IsStream t => (t IO Int -> SerialT IO Int) -> Word8 -> Property
@@ -396,11 +392,7 @@ constructWithUnfoldr listT op len =
396392 else Just (seed, seed + 1)
397393
398394constructWithFromPure ::
399− (IsStream t
400−#if __GLASGOW_HASKELL__ < 806
401− , Monoid (t IO Int)
402−#endif
403− )
395+ (IsStream t, Monoid (t IO Int))
404396 => ([Int] -> [Int])
405397 -> (t IO Int -> SerialT IO Int)
406398 -> Word8
@@ -416,11 +408,7 @@ constructWithFromPure listT op len =
416408 listEquals (==) (listT strm) list
417409
418410constructWithFromEffect ::
419− (IsStream t
420−#if __GLASGOW_HASKELL__ < 806
421− , Monoid (t IO Int)
422−#endif
423− )
411+ (IsStream t, Monoid (t IO Int))
424412 => ([Int] -> [Int])
425413 -> (t IO Int -> SerialT IO Int)
426414 -> Word8
@@ -1033,11 +1021,7 @@ foldFromList constr op eq = transformFromList constr eq id op
10331021
10341022-- XXX concatenate streams of multiple elements rather than single elements
10351023semigroupOps
1036− :: (IsStream t
1037−#if __GLASGOW_HASKELL__ < 804
1038− , Semigroup (t IO Int)
1039−#endif
1040− , Monoid (t IO Int))
1024+ :: (IsStream t, Monoid (t IO Int))
10411025 => String
10421026 -> ([Int] -> [Int] -> Bool)
10431027 -> (t IO Int -> SerialT IO Int)
@@ -1469,11 +1453,7 @@ bracketPartialStreamProp t vec =
14691453#endif
14701454
14711455bracketExceptionProp ::
1472− (IsStream t, MonadThrow (t IO)
1473−#if __GLASGOW_HASKELL__ < 806
1474− , Semigroup (t IO Int)
1475−#endif
1476− )
1456+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
14771457 => (t IO Int -> SerialT IO Int)
14781458 -> Property
14791459bracketExceptionProp t =
@@ -1560,11 +1540,7 @@ finallyPartialStreamProp t vec =
15601540#endif
15611541
15621542finallyExceptionProp ::
1563− (IsStream t, MonadThrow (t IO)
1564−#if __GLASGOW_HASKELL__ < 806
1565− , Semigroup (t IO Int)
1566−#endif
1567− )
1543+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
15681544 => (t IO Int -> SerialT IO Int)
15691545 -> Property
15701546finallyExceptionProp t =
@@ -1582,11 +1558,7 @@ finallyExceptionProp t =
15821558 assert $ refValue == 1
15831559
15841560onExceptionProp ::
1585− (IsStream t, MonadThrow (t IO)
1586−#if __GLASGOW_HASKELL__ < 806
1587− , Semigroup (t IO Int)
1588−#endif
1589− )
1561+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
15901562 => (t IO Int -> SerialT IO Int)
15911563 -> Property
15921564onExceptionProp t =
@@ -1620,11 +1592,7 @@ handleProp t vec =
16201592 assert $ res == vec ++ [0] ++ vec
16211593
16221594exceptionOps ::
1623− (IsStream t, MonadThrow (t IO)
1624−#if __GLASGOW_HASKELL__ < 806
1625− , Semigroup (t IO Int)
1626−#endif
1627− )
1595+ (IsStream t, MonadThrow (t IO), Semigroup (t IO Int))
16281596 => String
16291597 -> (t IO Int -> SerialT IO Int)
16301598 -> Spec