on master help sign in
Add `@since` annotations for `unsnoc` (from gh-173)
acf5018Herbert Valerio Riedel
Data/Text.hs+2
@@ -563,6 +563,8 @@ init (Text arr off len) | len <= 0 = emptyError "init"
563
563
564-- | /O(1)/ Returns all but the last character and the last character of a
564-- | /O(1)/ Returns all but the last character and the last character of a
565-- 'Text', or 'Nothing' if empty.
565-- 'Text', or 'Nothing' if empty.
566+--
567+-- @since 1.2.3.0
566unsnoc :: Text -> Maybe (Text, Char)
568unsnoc :: Text -> Maybe (Text, Char)
567unsnoc (Text arr off len)
569unsnoc (Text arr off len)
568 | len <= 0 = Nothing
570 | len <= 0 = Nothing
Data/Text/Lazy.hs+2
@@ -564,6 +564,8 @@ init Empty = emptyError "init"
564-- empty.
564-- empty.
565--
565--
566-- * It is no faster than using 'init' and 'last'.
566-- * It is no faster than using 'init' and 'last'.
567+--
568+-- @since 1.2.3.0
567unsnoc :: Text -> Maybe (Text, Char)
569unsnoc :: Text -> Maybe (Text, Char)
568unsnoc Empty = Nothing
570unsnoc Empty = Nothing
569unsnoc ts@(Chunk _ _) = Just (init ts, last ts)
571unsnoc ts@(Chunk _ _) = Just (init ts, last ts)