fromText

O(1). A Builder taking a Text, satisfying
Copy Text in a StrictBuilder
If the passed in Text can be parsed as an ASCII representation of a UUID, it will be. The hyphens may not be omitted.
O(n). Serialize a strict Unicode Text value using the UTF-8 encoding.
O(n). Serialize the lower 8-bits of all characters in the strict text.
Convert human‐readable text into a FilePath. This function ignores the user’s locale, and assumes all file paths are encoded in UTF8. If you need to create file paths with an unusual or obscure encoding, encode them manually and then use decode. Since: 0.2
Convert human‐readable text into a FilePath. This function ignores the user’s locale, and assumes all file paths are encoded in UTF8. If you need to create file paths with an unusual or obscure encoding, encode them manually and then use decode. Since: 0.2
Construct ShortText from Text This is <math> with text-2 when the Text is not sliced. Previously it wasn't because Text used UTF-16 as its internal representation.
Deprecated: Use Data.Text.unpack instead
Convert Text to a FilePath.
Encode Text using UTF-8. Only available when building with text-2.0 and newer. Since Text is backed by a UTF-8 byte sequence, this does not perform a copy.
Override this to avoid extra String conversions.
Construct a CharIterator from a Unicode string.
Contructs a new data type instance Like fromString, but from a Text input instead of String.
fromText == fromString . Text.unpack
Converts a Text into a YiString using defaultChunkSize-sized chunks for the underlying tree.
Encode Text to ByteString using UTF-8.
Same as mkKey but for Text
Create from Text, linear time.
Create from Text, linear time.
Create Builder, containing a given Text.
>>> :set -XOverloadedStrings

>>> fromText "foo" <> fromText "bar"
"foobar"
For literal strings it is faster to use fromAddr instead of fromText.