Add `@since` annotations for `unsnoc` (from gh-173)
commitacf50180b1c10a9f9681723a17c9f14863f3c688
authorHerbert Valerio Riedel <hvr@gnu.org>
dateSun 17 Dec 2017, 18:47 (9 years ago)
parente37aa52
Data/Text.hs+2
@@ -563,6 +563,8 @@ init (Text arr off len) | len <= 0 = emptyError "init"
563563
564564-- | /O(1)/ Returns all but the last character and the last character of a
565565-- 'Text', or 'Nothing' if empty.
566+--
567+-- @since 1.2.3.0
566568unsnoc :: Text -> Maybe (Text, Char)
567569unsnoc (Text arr off len)
568570 | len <= 0 = Nothing
Data/Text/Lazy.hs+2
@@ -564,6 +564,8 @@ init Empty = emptyError "init"
564564-- empty.
565565--
566566-- * It is no faster than using 'init' and 'last'.
567+--
568+-- @since 1.2.3.0
567569unsnoc :: Text -> Maybe (Text, Char)
568570unsnoc Empty = Nothing
569571unsnoc ts@(Chunk _ _) = Just (init ts, last ts)