3 ms·
> It is vacuously true that all elements of the empty set satisfy any given condition That could have been the entire article. Everything else is just fluff.
by bhaney 3y ago
> It is vacuously true that all elements of the empty set satisfy any given condition
That could have been the entire article. Everything else is just fluff.
- 082349872349872 3y agoit didn't even include useful fluff, like: every xs ∧ every ys == every (xs \concat ys) every [] ∧ every [True] == every ([] \concat [True]) every [] ∧ every [True] == every [True] every [] ∧ True == True every [] == True
- DemocracyFTW2 3y ago> That could have been the entire article As for me, except for this: Instead of reading every() as “does every item in this array match this condition?” read it as, “is there any item in this array that doesn’t match this condition?” That shift in thinking can help avoid errors in your JavaScript code going forward. When I last had to implement an `all_of( collection, test )` functionality, I was stumped as for the edge case of an empty collection, until I realized that I wanted `all_of( c, t )` to behave exactly like `none_of( c, nt )` with `nt = ( x ) -> not t( x )`