fromText
O(1). A
Builder taking a
Text, satisfying
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
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.
Contructs a new data type instance Like
fromString, but from a
Text input instead of
String.
fromText == fromString . Text.unpack
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.