https://github.com/composewell/streamly-text
Helper library for Streamly to interact with Text
https://github.com/composewell/streamly-text
Last synced: 6 months ago
JSON representation
Helper library for Streamly to interact with Text
- Host: GitHub
- URL: https://github.com/composewell/streamly-text
- Owner: composewell
- License: other
- Created: 2019-11-07T07:34:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-01T15:19:00.000Z (over 1 year ago)
- Last Synced: 2025-01-18T05:33:43.002Z (over 1 year ago)
- Language: Haskell
- Size: 13.7 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# streamly-text
Efficient interoperability between
[streamly](https://hackage.haskell.org/package/streamly) arrays and
[text](https://hackage.haskell.org/package/text).
The strict `Text` type is equivalent to UTF-8 encoded `Array Word8` in Streamly
and lazy `Text` type is equivalent to a stream of `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`.
This library provides zero-overhead and streaming conversions between
the `Text` type and `streamly` Array types, making it easier to use
Array and Array stream based functions on `Text`.
## Features
- **Strict `Text` ↔ `Array Word8`**
Convert between strict `Text` and `streamly`’s `Word8` stream or
`Array Word8` without any overhead.
- **Lazy `Text` ↔ Stream of `Array Word8`**
Convert between lazy `Text` and a stream of `Array Word8`.