Skip to content

Add singleton to Data.List.NonEmpty in libraries/base

Motivation

By convention the modules from containers provide a definition named singleton that allows constructing a container with a single element. This seems to be missing for Data.List.NonEmpty. Perhaps this proposal might even make sense for Data.List.

Proposal

Implement the trivial definition and export it in Data.List.NonEmpty.

Edited by muesli4
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information