I recently tried running the code:
> let _l_ = _l_
> any [True, _l_, False]
True
> any [False, _l_, True]
> -- _l_
I was wondering if this is considered correct behavior since any
is defined as foldr (||) False
and ||
is associative and commutative.
Shouldn't _l_ || True == True || _l_
be true, and (False || _l_) || True == False || (_l_ || True)
be true?
How would I implement an any
that would result in an associative, commutative function application?
I am new to trying to understand bottom; should ||
be returning at all?
Thanks