-import Prelude (Char, Bool, Int, Maybe, String,
+import Prelude (Char, Bool, Int, Maybe, String,
head t = S.head (stream t)
+-- | /O(1)/ Returns the first character and rest of a 'Text', or
+-- 'Nothing' if empty. Subject to array fusion.
+uncons :: Text -> Maybe (Char, Text)
+uncons t = case S.uncons (stream t) of
+ Just (c, s) -> Just (c, unstream s)
-- | /O(n)/ Returns the last character of a 'Text', which must be
-- non-empty. Subject to array fusion.