base-4.15.0.0
, both Data.List.singleton
and Data.List.NonEmpty.singleton
are available.
The list-singleton
is a Haskell package allows you to easily and clearly
create lists with only one element in them, which are typically called
"singleton lists" or simply "singletons".
For more details, read the announcement post on my blog or the documentation on Hackage.