
26 Apr
2010
26 Apr
'10
8:46 a.m.
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
Bjorn Buckwalter wrote: 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.