
8 May
2009
8 May
'09
12:43 p.m.
Does that also mean that you could write:
if 3 - 4 then ... else ... (= if (fromInteger 3 :: Bool) - (fromInteger 4 :: Bool) then ... else ...)
No. 3 - 4 is an Integer, the proposal is to convert Bools to Ints, not Ints to Bools.
Rather, (3 - 4) is a "(Num t) => t", so yes, this would work with instance Num Bool. *Main> if 3 - 4 then "yessirree" else "yep" "yep"
Yeah, the more people give examples of the power of Num Bool, the more it seems like a very bad idea!
+1 John