
Ivan Lazar Miljenovic schrieb:
On 3 September 2010 16:49, Henning Thielemann
wrote:
You might object, that it is seldom, that someone intentionally writes (a
Fair enough, but on the other hand I don't think we should make a fetish about enforcing _everything_ in the type system (non-empty lists, etc.).
I would like to express even more in type system. For instance I have recently invested several weeks for hunting space leaks in my code and I'm still not sure, I catched them all. A way to express absence of space leaks in the type system would save me a lot of time and would give me confidence. Regarding True=1 and False=0: Once I programmed in a language where True was represented by -1, because this is represented by bit pattern 1....1. The CPU has an instruction to fill a byte with the content of a flag and you can use this bit pattern for bitwise AND and OR operations. This makes this representation very efficient. This programming language also allowed comparison and conversion of True and False to their numeric representations. I used this intensively. Now imagine I port such programs to Haskell or C, I get lots of bugs for free.