Alternative.some and NonEmpty

Henning Thielemann lemming at henning-thielemann.de
Mon Mar 6 08:39:05 UTC 2017


On Sun, 5 Mar 2017, Vladislav Zavialov wrote:

> Since 'Data.List.NonEmpty' is now in 'base', it makes sense to change
> the type of 'some' from
>
> some :: Alternative f => f a -> f [a]
>
> to
>
> some :: Alternative f => f a -> f (NonEmpty a)
>
> as it's guaranteed to return a non-empty list.

A less invasive way would be to add a new function with that type.


More information about the Libraries mailing list