Proposal: instance Alternative ZipList

Edward Kmett ekmett at
Fri Jul 17 15:37:09 UTC 2015

The ZipList data type admits one legal Alternative instance

instance Alternative ZipList where
   pure = ZipList []
   ZipList xs <|> ZipList ys = ZipList (xs ++ drop (length xs) ys)

The legality of this instance was first noted in

I propose adding this instance, which acts like a generalized version of
the Alternative for Maybe, choosing with a left bias.

Discussion Period: 2 weeks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list