Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides Iso
s for converting lazy Text
to or from a
String
or Builder
, and an IxTraversal
for traversing the individual
characters of a Text
.
If you need to work with both strict and lazy text, Data.Text.Optics provides combinators that support both varieties using a typeclass.
Documentation
builder :: Iso' Text Builder Source #
Convert between lazy Text
and Builder
.
fromLazyText
x ≡ x^.
builder
toLazyText
x ≡ x^.
re
builder
utf8 :: Prism' ByteString Text Source #
Encode/Decode a lazy Text
to/from lazy ByteString
, via UTF-8.
Note: This function does not decode lazily, as it must consume the entire input before deciding whether or not it fails.
>>>
ByteString.unpack (utf8 # Text.pack "☃")
[226,152,131]