Alternative.some and NonEmpty
Mario Blažević
mblazevic at stilo.com
Tue Mar 7 17:09:47 UTC 2017
On 2017-03-07 11:40 AM, Henning Thielemann wrote:
>
> On Tue, 7 Mar 2017, Mario Blažević wrote:
>
>> If we're adding a new function, it might make more sense to add
>> something more generic, like
>>
>> genericMany, genericSome ::
>> (Alternative f, Applicative m, Monoid m) => f a -> f (m a)
>>
>> The expected type of these operations is usually fixed on the client
>> side.
>
> I think it must be Monoid (m a). But it won't work, because NonEmpty is
> no Monoid because there is no mempty.
You're correct on both counts, sorry about that. It would have to be
genericMany, genericSome ::
(Alternative f, Applicative m, Semigroup (m a)) => f a -> f (m a)
once Semigroup is in base.
More information about the Libraries
mailing list