diff --git a/src/Data/Text/Array.hs b/src/Data/Text/Array.hs index 979bf88e..5ca04d40 100644 --- a/src/Data/Text/Array.hs +++ b/src/Data/Text/Array.hs @@ -1,5 +1,12 @@ -{-# LANGUAGE BangPatterns, CPP, MagicHash, Rank2Types, - RecordWildCards, UnboxedTuples, UnliftedFFITypes #-} +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE Rank2Types #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE UnboxedTuples #-} +{-# LANGUAGE UnliftedFFITypes #-} + {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- | -- Module : Data.Text.Array @@ -24,8 +31,10 @@ module Data.Text.Array ( -- * Types - Array(..) - , MArray(..) + Array + , pattern ByteArray + , MArray + , pattern MutableByteArray -- * Functions , resizeM , shrinkM @@ -61,12 +70,13 @@ import GHC.ST (ST(..), runST) import GHC.Word (Word8(..)) import qualified Prelude import Prelude hiding (length, read, compare) +import Data.Array.Byte (ByteArray(..), MutableByteArray(..)) -- | Immutable array type. -data Array = ByteArray ByteArray# +type Array = ByteArray -- | Mutable array type, for use in the ST monad. -data MArray s = MutableByteArray (MutableByteArray# s) +type MArray = MutableByteArray -- | Create an uninitialized mutable array. new :: forall s. Int -> ST s (MArray s) diff --git a/text.cabal b/text.cabal index 6e3e0f12..0a49346a 100644 --- a/text.cabal +++ b/text.cabal @@ -189,6 +189,9 @@ library ghc-prim >= 0.2 && < 0.11, template-haskell >= 2.5 && < 2.20 + if impl(ghc < 9.4) + build-depends: data-array-byte >= 0.1 && < 0.2 + ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2 if flag(developer) ghc-options: -fno-ignore-asserts