PR Stanley wrote:
I think so, too. In Boolean algebra (which predates computers, much less
C), FALSE has traditionally been associated with 0, and TRUE with 1. And
since 1 > 0, TRUE > FALSE.
The question, however, still remains: why False = 0 and True 1? I
appreciate that it's so in boolean algebra but why? Why not True = 0
and False = 1?
Because if you take (&&) to be (*), and (||) to be (+), you get a
homomorphism between the two resulting algebras (assuming 1+1 = 1).
That is, if we define:
h(False) = 0
h(True) = 1
then:
h(a&&b) = h(a) * h(b)
h(a||b) = h(a) + h(b)
-Paul
P.S. Another reason to justify False < True is that show False < show
True. :-)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe