Skip to content

Commit 056bf4b

Browse files
andreasabelandrewthad
authored andcommitted
Fix some warnings for GHC 8.0, 8.4 up, 9.4
1 parent d5b8996 commit 056bf4b

File tree

7 files changed

+17
-6
lines changed

7 files changed

+17
-6
lines changed

Control/Monad/Primitive.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ import GHC.Exts ( State#, RealWorld, noDuplicate#, touch#
3333
import GHC.IO ( IO(..) )
3434
import GHC.ST ( ST(..) )
3535

36+
#if __GLASGOW_HASKELL__ >= 802
3637
import qualified Control.Monad.ST.Lazy as L
38+
#endif
3739

3840
import Control.Monad.Trans.Class (lift)
3941

Data/Primitive/Array.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ instance Semigroup (Array a) where
762762
instance Monoid (Array a) where
763763
mempty = empty
764764
#if !(MIN_VERSION_base(4,11,0))
765-
mappend = (<|>)
765+
mappend = (<>)
766766
#endif
767767
mconcat l = createArray sz (die "mconcat" "impossible") $ \ma ->
768768
let go !_ [ ] = return ()

Data/Primitive/ByteArray.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ import Control.Monad.Primitive
7070
import Control.Monad.ST
7171
import Data.Primitive.Types
7272

73+
#if MIN_VERSION_base(4,10,0)
7374
import qualified GHC.ST as GHCST
75+
#endif
7476

7577
import Foreign.C.Types
7678
import Data.Word ( Word8 )
79+
#if __GLASGOW_HASKELL__ >= 802
7780
import qualified GHC.Exts as Exts
81+
#endif
7882
import GHC.Exts hiding (setByteArray#)
7983

8084
#if __GLASGOW_HASKELL__ < 804

Data/Primitive/PrimArray.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,24 @@ module Data.Primitive.PrimArray
110110
import GHC.Exts
111111
import Data.Primitive.Types
112112
import Data.Primitive.ByteArray (ByteArray(..))
113+
#if !MIN_VERSION_base(4,11,0)
113114
import Data.Monoid ((<>))
115+
#endif
114116
import Control.Applicative
115117
import Control.DeepSeq
116118
import Control.Monad.Primitive
117119
import Control.Monad.ST
118120
import qualified Data.List as L
119121
import qualified Data.Primitive.ByteArray as PB
120122
import qualified Data.Primitive.Types as PT
123+
#if MIN_VERSION_base(4,10,0)
121124
import qualified GHC.ST as GHCST
125+
#endif
122126
import Language.Haskell.TH.Syntax (Lift (..))
123127

128+
#if !MIN_VERSION_base(4,11,0)
124129
import Data.Semigroup (Semigroup)
130+
#endif
125131
import qualified Data.Semigroup as SG
126132

127133
#if __GLASGOW_HASKELL__ >= 802

Data/Primitive/SmallArray.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ import Control.Monad.Zip
8080
import Data.Data
8181
import Data.Foldable as Foldable
8282
import Data.Functor.Identity
83-
#if !(MIN_VERSION_base(4,10,0))
84-
import Data.Monoid
85-
#endif
8683
import qualified GHC.ST as GHCST
8784
import qualified Data.Semigroup as Sem
8885
import Text.ParserCombinators.ReadP
@@ -798,7 +795,7 @@ instance Sem.Semigroup (SmallArray a) where
798795
instance Monoid (SmallArray a) where
799796
mempty = empty
800797
#if !(MIN_VERSION_base(4,11,0))
801-
mappend = (<|>)
798+
mappend = (Sem.<>)
802799
#endif
803800
mconcat l = createSmallArray n (die "mconcat" "impossible") $ \ma ->
804801
let go !_ [ ] = return ()

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ packages: primitive.cabal
22

33

44
package primitive
5-
ghc-options: -Wall
5+
ghc-options: -Wall -Wcompat
66

77
allow-newer: tagged-0.8.6.1:template-haskell

primitive.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Tested-With:
3131

3232
Library
3333
Default-Language: Haskell2010
34+
Default-Extensions:
35+
TypeOperators
3436
Other-Extensions:
3537
BangPatterns, CPP, DeriveDataTypeable,
3638
MagicHash, TypeFamilies, UnboxedTuples, UnliftedFFITypes

0 commit comments

Comments
 (0)