singleton

Construct a list from a single element.

Examples

>>> singleton True
[True]
>>> singleton [1, 2, 3]
[[1,2,3]]
>>> singleton 'c'
"c"
Construct a NonEmpty list from a single element.
O(1) Convert a Word8 into a ByteString
O(1) Convert a Char into a ByteString
O(1) Convert a Word8 into a ShortByteString
O(1) Convert a character into a Text. Performs replacement on invalid scalar values.
O(1). A Builder taking a single character, satisfying
O(1) Convert a character into a Stream Properties
unstream . singleton = singleton
A map of one element.
singleton 1 'a'        == fromList [(1, 'a')]
size (singleton 1 'a') == 1
A set of one element.
A map with a single element.
singleton 1 'a'        == fromList [(1, 'a')]
size (singleton 1 'a') == 1
A singleton sequence.
Create a singleton set.
Construct a map with a single element.
Construct a map with a single element.
Construct a set with a single element.
>>> HashSet.singleton 1
fromList [1]
O(1). Generate a singleton Deque
>>> singleton 1
BD 1 [1] 0 []
O(1). A Builder taking a single byte, satisfying
Construct a range which represents a constant single value.
>>> bounds x $ singleton 5
(5,5)
>>> origin $ singleton 5
5
A map of one element.
singleton 1 'a'        == fromList [(1, 'a')]
size (singleton 1 'a') == 1
A set of one element.
Create a byte array from a single byte
singleton x is a DList with the single element x. singleton obeys the law:
toList (singleton x) = [x]