Have you ever found yourself typing the five-character Haskell expression (:[]) and thinking to yourself, “I wish I could add an external dependency for this”? If so, great news! I published the list-singleton package today and it does just that.

Seriously though, I’m on a quest to add this singleton function to Data.List (and Data.List.NonEmpty ):

singleton :: a -> [ a ] singleton a = [ a ]

You’re probably thinking that there are plenty of ways to make singleton lists already. You’re right! However I think it would be useful to have a documented, monomorphic function for this exact use case. Check out the singleton documentation for a deep dive.

I submitted a proposal to the Core Libraries Committee nearly a month ago. Although it generated a fair amount of discussion, it doesn’t seem to me like the CLC is any closer to deciding on it.