Skip to content
Draft
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
24 changes: 22 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,35 @@
* This allows utilities like `syb:Data.Generics.Text.gread` to be meaningfully used at these types containing `ByteString`s.
* [`fromListN` in `instance IsList ByteString` truncates input list if it's longer than the size hint](https://github.com/haskell/bytestring/pull/672)

<!--
[minor version number] — Month Year

* Bug fixes:
* API additions and behavior changes:
* Data.ByteString.Short now provides `lazyToShort` and `lazyFromShort`.
* Deprecations:
* Performance improvements:
* Miscellaneous:
* Internal stuff:
-->

[0.12.3.0] — TBA 2025

<!--
* Bug fixes:
* [Fix build in the presence of sketchy upstream CPP that triggers `-Wundef`](https://github.com/haskell/bytestring/pull/711)
* (See [#665](https://github.com/haskell/bytestring/issues/665) and [#709](https://github.com/haskell/bytestring/issues/709).)
* API additions and behavior changes:
* [`Data.ByteString.Short` now provides `lazyToShort` and `lazyFromShort`.](https://github.com/haskell/bytestring/pull/619)
* Deprecations:
* Performance improvements:
* [Use only unsigned ints in the C itoa functions](https://github.com/haskell/bytestring/pull/702)
* [Remove a dead branch in `integerDec`](https://github.com/haskell/bytestring/pull/702)
* Miscellaneous:
* [Remove useless INLINE on `compareLength` for lazy bytestrings.](https://github.com/haskell/bytestring/pull/705)
* [Drop support for GHC < 8.6](https://github.com/haskell/bytestring/pull/710)
* Various documentation improvements ([1](https://github.com/haskell/bytestring/pull/710), [2](https://github.com/haskell/bytestring/pull/713))
<!--
* Internal stuff:
* Various CI tweaks ([1](https://github.com/haskell/bytestring/pull/703), [2](https://github.com/haskell/bytestring/pull/706))
-->

[0.12.2.0] — October 2024
Expand Down
3 changes: 3 additions & 0 deletions Data/ByteString/Short/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ toShortIO (BS fptr len) = do

-- | A simple wrapper around 'fromShort' that wraps the strict 'ByteString' as
-- a one-chunk 'LBS.LazyByteString'.
--
-- @since 0.12.3.0
lazyFromShort :: ShortByteString -> LBS.ByteString
lazyFromShort = LBS.fromStrict . fromShort

Expand All @@ -464,6 +466,7 @@ lazyFromShort = LBS.fromStrict . fromShort
-- used only with sufficiently short lazy ByteStrings. The entire lazy
-- ByteString is brought into memory before a copy is made.
--
-- @since 0.12.3.0
lazyToShort :: LBS.ByteString -> ShortByteString
lazyToShort LBS.Empty = empty
lazyToShort lbs = unsafeDupablePerformIO $ do
Expand Down
Loading