cons

Synonym for <|.
O(n) cons is analogous to (:) for lists, but of different complexity, as it requires making a copy.
O(n) cons is analogous to (:) for lists, but of different complexity, as it requires a memcpy.
O(1) cons is analogous to (:) for lists.
O(1) cons is analogous to (:) for lists.
O(n) cons is analogous to (:) for lists. Note: copies the entire byte array
O(n) Adds a character to the front of a Text. This function is more costly than its List counterpart because it requires copying a new array. Performs replacement on invalid scalar values.
O(n) Adds a character to the front of a Stream Char. Properties
unstream . cons c . stream = cons c
O(1) Adds a character to the front of a Text.
cons an element onto a container.
>>> cons a []
[a]
>>> cons a [b, c]
[a,b,c]
>>> cons a (Seq.fromList [])
fromList [a]
>>> cons a (Seq.fromList [b, c])
fromList [a,b,c]
Append an element to the start of a list, an alias for (:).
cons 't' "est" == "test"
\x xs -> uncons (cons x xs) == Just (x,xs)
prepend a single byte to a byte array
prepend a single byte to a byte array
cons x xs is a DList with the head x and the tail xs. <math>(1). cons obeys the law:
toList (cons x xs) = x : toList xs
cons x xs is a DNonEmpty with the head x and the tail xs. <math>(1). cons obeys the law:
toNonEmpty (cons x xs) = cons x (toNonEmpty xs)
cons = (:)
The natural cons for a Stream (Of a).
cons a stream = yield a >> stream
Useful for interoperation:
Data.Text.foldr S.cons (return ()) :: Text -> Stream (Of Char) m ()
Lazy.foldrChunks S.cons (return ()) :: Lazy.ByteString -> Stream (Of Strict.ByteString) m ()
and so on.
O(1) cons is analogous to (:) for lists.
O(n) Adds a character to the front of a Text. This function is more costly than its List counterpart because it requires copying a new array. Subject to fusion. Performs replacement on invalid scalar values.
O(1) Adds a character to the front of a Text. Subject to fusion.
O(n) Prepend an element
O(n) Prepend an element
O(n) Prepend an element
O(n) Prepend an element
Prepend an element onto a sequence.
> 4 `cons` [1,2,3]
[4,1,2,3]