Skip to content

Commit

Permalink
Add StrictByteString & LazyByteString type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleidukos committed Mar 18, 2021
1 parent b639596 commit 57d92a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Data/ByteString/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module Data.ByteString.Internal (
, PS -- backwards compatibility shim
),

StrictByteString,

-- * Internal indexing
findIndexOrLength,

Expand Down Expand Up @@ -201,6 +203,8 @@ data ByteString = BS {-# UNPACK #-} !(ForeignPtr Word8) -- payload
-- ^ @since 0.11.0.0
deriving (Typeable)

-- | Type synonym for the strict flavour of ByteString
type StrictByteString = ByteString

-- |
-- @'PS' foreignPtr offset length@ represents a 'ByteString' with data
Expand Down
4 changes: 4 additions & 0 deletions Data/ByteString/Lazy/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module Data.ByteString.Lazy.Internal (

-- * The lazy @ByteString@ type and representation
ByteString(..),
LazyByteString,
chunk,
foldrChunks,
foldlChunks,
Expand Down Expand Up @@ -80,6 +81,9 @@ data ByteString = Empty | Chunk {-# UNPACK #-} !S.ByteString ByteString
deriving (Typeable)
-- See 'invariant' function later in this module for internal invariants.

-- | Type synonym for the lazy flavour of ByteString
type LazyByteString = ByteString

instance Eq ByteString where
(==) = eq

Expand Down

0 comments on commit 57d92a1

Please sign in to comment.