streamly-text: Efficient conversion between Streamly Arrays and Text

[ array, bsd3, library, stream, streamly, text ] [ Propose Tags ] [ Report a vulnerability ]

Zero-overhead interoperability between the Array type from the streamly-core package and the Text type from the text package.

Provides efficient conversion in both directions without copying.

Please see the README at https://github.com/composewell/streamly-text for more details.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.1.1
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), streamly-core (>=0.2.0 && <0.4), text (>=2.0 && <2.2) [details]
Tested with ghc ==9.14.1, ghc ==9.12.4, ghc ==9.10.3, ghc ==9.8.4, ghc ==9.6.3, ghc ==9.4.8, ghc ==9.2.8, ghc ==8.10.7
License BSD-3-Clause
Author Composewell Technologies
Maintainer streamly@composewell.com
Uploaded by harendra at 2026-04-15T17:30:30Z
Category Streamly, Stream, Array, Text
Distributions
Downloads 30 total (10 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-04-15 [all 1 reports]

Readme for streamly-text-0.1.1

[back to package description]

streamly-text

Efficient interoperability between streamly arrays and text.

This library provides zero-overhead conversions between the Text type and streamly Array types, making it easier to use one in place of the other. While text uses unpinned memory, streamly arrays can use pinned or unpinned memory and can be intercoverted if required.

The strict Text type is equivalent to UTF-8 encoded Array Word8 in Streamly, the underlying types are compatible so we just need to rewrap it to interconvert.

In streamly we work with explicit streams instead of lazy types. The lazy 'Text' type is equivalent to a stream of UTF-8 encoded 'Array Word8' in streamly.

When working with streams we can work directly with Char streams or with streams of encoded chunks of char sequences i.e. Array Word8. A Char stream can be converted to UTF-8 encoded Word8 stream using encodeUtf8 from Streamly.Unicode.Stream which in turn can be written as Array Word8, and a stream of UTF-8 encoded Word8 or Array Word8 can be decoded using decodeUtf8 or decodeUtf8Chunks.