# Text -> ByteString

Encode text using big endian UTF-16 encoding.

Encode text using little endian UTF-16 encoding.

Encode text using big endian UTF-32 encoding.

Encode text using little endian UTF-32 encoding.

Encode text using UTF-8 encoding.

*O(n)* The unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is a prepending to the ByteString and b is used as the next element in a recursive call.
*O(n)*, unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is the next byte in the string, and b is the seed value for further production.
Examples:
> unfoldr (\x -> if x <= 5 then Just (x, x + 1) else Nothing) 0
> == pack [0, 1, 2, 3, 4, 5]
*O(n)* The unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is a prepending to the ByteString and b is used as the next element in a recursive call.
*O(n)*, unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is the next character in the string, and b is the seed value for further production.
Examples:
> unfoldr (\x -> if x <= '9' then Just (x, succ x) else Nothing) '0' == "0123456789"
Raise any value as an exception, provided it is in the Typeable class.
Consume the chunks of a lazy Text with a strict, tail-recursive, accumulating left fold.
*O(n)* foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a Text, reduces the Text using the binary operator, from left to right. Subject to fusion.
*O(n)* A strict version of foldl. Subject to fusion.
Consume the chunks of a lazy Text with a natural right fold.
*O(n)* foldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a Text, reduces the Text using the binary operator, from right to left. Subject to fusion.
the deep analogue of $!. In the expression f $!! x, x is fully evaluated before the function f is applied to it.
Application operator. This operator is redundant, since ordinary application (f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:
> f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as map ($ 0) xs, or Data.List.zipWith ($) fs xs.
Strict (call-by-value) application, defined in terms of seq.
Show more results