Efficient interoperability between streamly arrays and 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
.
-
Strict
Text
↔Array Word8
Convert between strictText
andstreamly
’sWord8
stream orArray Word8
without any overhead. -
Lazy
Text
↔ Stream ofArray Word8
Convert between lazyText
and a stream ofArray Word8
.