diff options
author | Harry Garrood <harry@garrood.me> | 2022-08-24 14:22:21 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-25 20:06:10 -0400 |
commit | 8603c92113c49557f8632675a01f3b3874b819d1 (patch) | |
tree | 60d7dbbbd692f29af26be3321d40c296c01a8395 /libraries/base | |
parent | d387f687930e4d44c1ef569b4ec8091cb8b92765 (diff) | |
download | haskell-8603c92113c49557f8632675a01f3b3874b819d1.tar.gz |
Add since annotations and changelog entries
Diffstat (limited to 'libraries/base')
-rw-r--r-- | libraries/base/Data/List/NonEmpty.hs | 4 | ||||
-rw-r--r-- | libraries/base/changelog.md | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libraries/base/Data/List/NonEmpty.hs b/libraries/base/Data/List/NonEmpty.hs index e5d8869818..03f631a2a7 100644 --- a/libraries/base/Data/List/NonEmpty.hs +++ b/libraries/base/Data/List/NonEmpty.hs @@ -232,6 +232,8 @@ inits = fromList . List.inits . Foldable.toList -- -- > inits1 (1 :| [2,3]) == (1 :| []) :| [1 :| [2], 1 :| [2,3]] -- > inits1 (1 :| []) == (1 :| []) :| [] +-- +-- @since 4.18 inits1 :: NonEmpty a -> NonEmpty (NonEmpty a) inits1 = -- fromList is an unsafe function, but this usage should be safe, since: @@ -258,6 +260,8 @@ tails = fromList . List.tails . Foldable.toList -- -- > tails1 (1 :| [2,3]) == (1 :| [2,3]) :| [2 :| [3], 3 :| []] -- > tails1 (1 :| []) == (1 :| []) :| [] +-- +-- @since 4.18 tails1 :: NonEmpty a -> NonEmpty (NonEmpty a) tails1 = -- fromList is an unsafe function, but this usage should be safe, since: diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index d05df102f2..feba1bfbc8 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -21,6 +21,7 @@ function. * `GHC.Conc.Sync.threadLabel` was added, allowing the user to query the label of a given `ThreadId`. + * Add `inits1` and `tails1` to `Data.List.NonEmpty`. ## 4.17.0.0 *August 2022* |