[Haskell-cafe] Data.Foldable.all and empty list

David Kraeutmann kane at kane.cx
Tue Sep 29 21:37:19 UTC 2015

Completely intentional.
'all' tests whether the predicate is true for all elements; if there are no elements, it's vacuously true (cf. forall quantifier in logic).

On 9/29/2015 11:33 PM, Lana Black wrote:
> Hello,
> Is there any particular reason why the 'all' function returns True when
> supplied with an empty list (or any other foldable)? I'm aware that it
> is implemented via All monoid instance, my question is whether this
> behaviour is intentional or it can be considered a bug.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4291 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150929/3c48d4e3/attachment.bin>

More information about the Haskell-Cafe mailing list