diff --git a/src-ghc804/PrimOps.hs b/src-ghc804/PrimOps.hs new file mode 100644 index 0000000..b4faa72 --- /dev/null +++ b/src-ghc804/PrimOps.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE Unsafe #-} + +module PrimOps ( compareByteArrays# ) where + +import GHC.Exts (compareByteArrays#) diff --git a/src/Data/Text/Short/Internal.hs b/src/Data/Text/Short/Internal.hs index a4b66a5..0ad0563 100644 --- a/src/Data/Text/Short/Internal.hs +++ b/src/Data/Text/Short/Internal.hs @@ -92,7 +92,7 @@ import qualified PrimOps -- It can be shown that for realistic data . -- newtype ShortText = ShortText ShortByteString - deriving (Monoid,Semigroup,Hashable,NFData) + deriving (Monoid,Data.Semigroup.Semigroup,Hashable,NFData) instance Eq ShortText where {-# INLINE (==) #-} diff --git a/text-short.cabal b/text-short.cabal index 0ff5c71..317ecfc 100644 --- a/text-short.cabal +++ b/text-short.cabal @@ -37,8 +37,12 @@ library if !impl(ghc >= 8.0) build-depends: semigroups >= 0.18.2 && < 0.19 - c-sources: cbits/memcmp.c - hs-source-dirs: src-ghc708 + -- GHC version specific PrimOps + if impl(ghc >= 8.4) + hs-source-dirs: src-ghc804 + else + c-sources: cbits/memcmp.c + hs-source-dirs: src-ghc708 other-modules: PrimOps hs-source-dirs: src