cons package:text

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.
O(1) Returns the first character and rest of a Text, or Nothing if empty.
O(1) Returns the first character and remainder of a Stream Char, or Nothing if empty. Properties
fmap fst . uncons . stream = fmap fst . uncons
fmap (unstream . snd) . uncons . stream = fmap snd . uncons