Skip to content

Commit

Permalink
added StrictTextBuilder and LazyTextBuilder aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
BebeSparkelSparkel committed Apr 14, 2024
1 parent 19725eb commit e9a9bb6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Data/Text/Encoding.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module Data.Text.Encoding
, Utf8State
, startUtf8State
, StrictBuilder
, StrictTextBuilder
, strictBuilderToText
, textToStrictBuilder

Expand Down
3 changes: 3 additions & 0 deletions src/Data/Text/Internal/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module Data.Text.Internal.Builder
( -- * Public API
-- ** The Builder type
Builder
, LazyTextBuilder
, toLazyText
, toLazyTextWith

Expand Down Expand Up @@ -96,6 +97,8 @@ newtype Builder = Builder {
-> ST s [S.Text]
}

type LazyTextBuilder = Builder

instance Semigroup Builder where
(<>) = append
{-# INLINE (<>) #-}
Expand Down
3 changes: 2 additions & 1 deletion src/Data/Text/Internal/Encoding.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Data.Text.Internal.Encoding
, Utf8State
, startUtf8State
, StrictBuilder()
, StrictTextBuilder
, strictBuilderToText
, textToStrictBuilder

Expand All @@ -50,7 +51,7 @@ import Data.Text.Encoding.Error (OnDecodeError)
import Data.Text.Internal (Text(..))
import Data.Text.Internal.Encoding.Utf8
(DecoderState, utf8AcceptState, utf8RejectState, updateDecoderState)
import Data.Text.Internal.StrictBuilder (StrictBuilder)
import Data.Text.Internal.StrictBuilder (StrictBuilder, StrictTextBuilder)
import qualified Data.ByteString as B
import qualified Data.ByteString.Internal as BI
import qualified Data.ByteString.Short.Internal as SBS
Expand Down
3 changes: 3 additions & 0 deletions src/Data/Text/Internal/StrictBuilder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

module Data.Text.Internal.StrictBuilder
( StrictBuilder(..)
, StrictTextBuilder
, toText
, fromChar
, fromText
Expand Down Expand Up @@ -49,6 +50,8 @@ data StrictBuilder = StrictBuilder
, sbWrite :: forall s. A.MArray s -> Int -> ST s ()
}

type StrictTextBuilder = StrictBuilder

-- | Use 'StrictBuilder' to build 'Text'.
--
-- @since 2.0.2
Expand Down
1 change: 1 addition & 0 deletions src/Data/Text/Lazy/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
module Data.Text.Lazy.Builder
( -- * The Builder type
Builder
, LazyTextBuilder
, toLazyText
, toLazyTextWith

Expand Down

0 comments on commit e9a9bb6

Please sign in to comment.