Skip to content

Commit

Permalink
Add @since annotations for unsnoc (from haskellgh-173)
Browse files Browse the repository at this point in the history
  • Loading branch information
hvr committed Dec 17, 2017
1 parent e37aa52 commit acf5018
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Data/Text.hs
Expand Up @@ -563,6 +563,8 @@ init (Text arr off len) | len <= 0 = emptyError "init"

-- | /O(1)/ Returns all but the last character and the last character of a
-- 'Text', or 'Nothing' if empty.
--
-- @since 1.2.3.0
unsnoc :: Text -> Maybe (Text, Char)
unsnoc (Text arr off len)
| len <= 0 = Nothing
Expand Down
2 changes: 2 additions & 0 deletions Data/Text/Lazy.hs
Expand Up @@ -564,6 +564,8 @@ init Empty = emptyError "init"
-- empty.
--
-- * It is no faster than using 'init' and 'last'.
--
-- @since 1.2.3.0
unsnoc :: Text -> Maybe (Text, Char)
unsnoc Empty = Nothing
unsnoc ts@(Chunk _ _) = Just (init ts, last ts)
Expand Down

0 comments on commit acf5018

Please sign in to comment.