Skip to content

Commit

Permalink
Switch Data.Text.Array to Data.Array.Byte
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Oct 7, 2022
1 parent f66ee14 commit 9632f74
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/Data/Text/Array.hs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,8 +31,10 @@
module Data.Text.Array
(
-- * Types
Array(..)
, MArray(..)
Array
, pattern ByteArray
, MArray
, pattern MutableByteArray
-- * Functions
, resizeM
, shrinkM
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions text.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9632f74

Please sign in to comment.