Skip to content

Commit

Permalink
Add since metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
kindaro committed Feb 15, 2024
1 parent 4165f6a commit 0458012
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Data/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,8 @@ inits = (NonEmptyList.toList $!) . initsNE

-- | /O(n)/ Return all initial segments of the given 'Text', shortest
-- first.
--
-- @since 2.1.2
initsNE :: Text -> NonEmptyList.NonEmpty Text
initsNE t = empty NonEmptyList.:| case t of
Text arr off len ->
Expand All @@ -1544,6 +1546,8 @@ tails = (NonEmptyList.toList $!) . tailsNE

-- | /O(n)/ Return all final segments of the given 'Text', longest
-- first.
--
-- @since 2.1.2
tailsNE :: Text -> NonEmptyList.NonEmpty Text
tailsNE t
| null t = empty NonEmptyList.:| []
Expand Down
4 changes: 4 additions & 0 deletions src/Data/Text/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,8 @@ inits = (NE.toList P.$!) . initsNE

-- | /O(n)/ Return all initial segments of the given 'Text',
-- shortest first.
--
-- @since 2.1.2
initsNE :: Text -> NonEmpty Text
initsNE = (Empty NE.:|) . inits'
where inits' Empty = []
Expand All @@ -1446,6 +1448,8 @@ tails = (NE.toList P.$!) . tailsNE

-- | /O(n)/ Return all final segments of the given 'Text', longest
-- first.
--
-- @since 2.1.2
tailsNE :: Text -> NonEmpty Text
tailsNE Empty = Empty :| []
tailsNE ts@(Chunk t ts')
Expand Down

0 comments on commit 0458012

Please sign in to comment.