Bjorn Buckwalter wrote:
Dear all,

Does it make good sense that 'and []' returns 'True' and 'or []'
returns 'False'?
It's certainly what I would expect it to do, based on several ways of thinking.

1: If we define the function using explicit recursion:
and (x:xs) = x && and xs
Therefore and [] has to be True.  Similar logic for or.

2: My instinct is to consider "and = all (== True)", while "or = any (== True)". It's even clearer to me that "all [] = True" and "any [] = False" (similiar to Miguel's post).

Thanks,

Neil.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to