Moduleoptics-extra-0.4.2.1Haskell2010
Data.Text.Strict.Optics
This module provides Isos for converting strict 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.
- 6 values
- Packageoptics-extra-0.4.2.1
- Exports7
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceOptics.hs
This isomorphism can be used to unpack (or pack) strict Text.
Strict.pack "hello" ^. unpacked -- :: String"hello"
This Iso is provided for notational convenience rather than out of great need, since
unpacked ≡ re packed
pack x ≡ x ^. re unpacked
unpack x ≡ x ^. packed
unpacked ≡ iso unpack pack
Encode/Decode a strict Text to/from strict ByteString, via UTF-8.
utf8 # Strict.pack "☃""\226\152\131"