streamly-text
Safe HaskellNone
LanguageHaskell2010

Streamly.Compat.Text

Synopsis

Documentation

toArray :: Text -> Array Word8 Source #

Convert a Text to an array of Word8. It can be done in constant time.

unsafeFromArray :: Array Word8 -> Text Source #

Treat an an array of Word8 as Text.

This function is unsafe: the caller must ensure that the Array Word8 is a valid UTF-8 encoding.

This function unwraps the Array and wraps it with Text constructors and hence the operation is performed in constant time.

reader :: forall (m :: Type -> Type). Monad m => Unfold m Text Word8 Source #

Unfold a Text to a stream of Word8.

unsafeCreate :: forall (m :: Type -> Type). MonadIO m => Fold m Word8 Text Source #

Fold a stream of Word8 to a Text of appropriate size.