toText -package:hslua-core

Use StrictBuilder to build Text.
Convert a UUID into a hyphentated string using lower-case letters.
Attempt to convert a FilePath to human‐readable text. If the path is decoded successfully, the result is a Right containing the decoded text. Successfully decoded text can be converted back to the original path using fromText. If the path cannot be decoded, the result is a Left containing an approximation of the original path. If displayed to the user, this value should be accompanied by some warning that the path has an invalid encoding. Approximated text cannot be converted back to the original path. This function ignores the user’s locale, and assumes all file paths are encoded in UTF8. If you need to display file paths with an unusual or obscure encoding, use encode and then decode them manually. Since: 0.2
Attempt to convert a FilePath to human‐readable text. If the path is decoded successfully, the result is a Right containing the decoded text. Successfully decoded text can be converted back to the original path using fromText. If the path cannot be decoded, the result is a Left containing an approximation of the original path. If displayed to the user, this value should be accompanied by some warning that the path has an invalid encoding. Approximated text cannot be converted back to the original path. This function ignores the user’s locale, and assumes all file paths are encoded in UTF8. If you need to display file paths with an unusual or obscure encoding, use encode and then decode them manually. Since: 0.2
Convert UTF8-encoded ByteString to Text, also removing '\r' characters.
Convert to Text
(fromText . toText) t == t
(toText . fromText) t == t
This is <math> with text-2. Previously it wasn't because Text used UTF-16 as its internal representation.
Convert a Builder to a strict Text. Since: 2
Deprecated: Use Data.Text.pack instead
Turn a simple string into XML text.
Interpret byte sequence as ASCII codepoints. Only available when building with text-2.0 and newer. Returns Nothing if any of the bytes are outside of the range 0x00-0x7F
Attempt to interpret byte sequence as UTF-8 encoded Text. Only available when building with text-2.1 and newer. Since Text is backed by a UTF-8 byte sequence, this does not perform a copy.
Converts the monoid into Text, given a function to convert the non-character factors into chunks of Text.
Consider whether you really need to use this!
Cast to Text, for types for which this is known to be safe. For general casts, use castTo.
Execute the builder producing a strict text.
Extract Text, O(1).
Glue chunks into Text, linear time.
Convert a number to Text.
Convert given value to Text.
Convert a Version to a strict Text representation. Note: Equivalent to toStrict . toLazyText