Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Note: Prior to version 0.3.4.0, this library was named
`small-bytearray-builder` is now just a compatibility shim
to ease the migration process.

## 0.3.17.0

* Add `hPut` to help with common case of pushing logs to stderr.

## 0.3.16.3

* Add support for building with GHC 9.10
Expand Down
2 changes: 1 addition & 1 deletion bytebuild.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: bytebuild
version: 0.3.16.3
version: 0.3.17.0
synopsis: Build byte arrays
description:
This is similar to the builder facilities provided by
Expand Down
9 changes: 9 additions & 0 deletions src/Data/Bytes/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ module Data.Bytes.Builder

-- * Rebuild
, rebuild

-- * IO
, hPut
) where

import Prelude hiding (replicate)
Expand Down Expand Up @@ -209,6 +212,7 @@ import GHC.Natural (naturalFromInteger, naturalToInteger)
import GHC.ST (ST (ST))
import GHC.Word (Word (W#), Word8 (W8#))
import Numeric.Natural (Natural)
import System.IO (Handle)

import qualified Compat as C

Expand All @@ -217,6 +221,7 @@ import qualified Arithmetic.Types as Arithmetic
import qualified Data.Bytes as Bytes
import qualified Data.Bytes.Builder.Bounded as Bounded
import qualified Data.Bytes.Builder.Bounded.Unsafe as UnsafeBounded
import qualified Data.Bytes.Chunks as Chunks
import qualified Data.Primitive as PM
import qualified Data.Text.Short as TS
import qualified GHC.Exts as Exts
Expand Down Expand Up @@ -1557,3 +1562,7 @@ rebuild :: Builder -> Builder
{-# INLINE rebuild #-}
rebuild (Builder f) = Builder $ oneShot $ \a -> oneShot $ \b -> oneShot $ \c -> oneShot $ \d -> oneShot $ \e ->
f a b c d e

hPut :: Handle -> Builder -> IO ()
{-# NOINLINE hPut #-}
hPut h = Chunks.hPut h . run 256
Loading