3 ms·
This is a nice clean criterion, but it's still pretty unclear to me why the zero element of a monoid should be considered falsey at all.
by StefanKarpinski 13y ago
This is a nice clean criterion, but it's still pretty unclear to me why the zero element of a monoid should be considered falsey at all.
- chrismonsanto 13y agoBecause when writing a recursive function, the zero element is generally the base case. if x: <destructure x, recurse on subparts> else: return <something> This applies to (natural) numbers as well--'destructuring' usually means decrementing the number.