A Futile War on Drugs that Wastes Money and Wrecks Lives
ft.com1 pointsby throwaway13qf850 comments
duplicate :: a -> (a, a)
and delete :: a -> ()
are not allowed in a linear type system. Practically, this means that many operations can be optimized by the compiler to in-place mutations, because it is guaranteed that there is only ever one reference to a particular object. y = x ^ (x ^ x ^ x ^ ...)
= x ^ y
and hence x = y ^ (1/y)
= exp( 1/y * log(y) )
which is defined for y > 0. y = x ^ (x ^ x ^ x ^ ...)
is dual-valued, i.e. it is not a mathematical function. For it to be a function, you need to specify whether you are on the upper branch (so that y = 4) or the lower branch (so that y = 2). Deliberately obfuscating the difference between the two branches leads to the conclusion that 2 = 4. y = x^2
and hence the "function" x = sqrt(y)
is not really a function unless we specify whether we are on the upper (x > 0) or lower (x < 0) branch. By convention we interpret sqrt(y) to be the upper branch, and write -sqrt(y) for the lower branch, but there's nothing that forces that choice.
More mathematically, you can think of the Hasse diagram as a lattice, with the meet and join operations being AND and OR. For example, we are used to thinking of the expression
as being true if p is true and q is true. But what if we have four values: {}, {T}, {F} and {T,F}? The Hasse diagram tells us how to interpret expression like this - p AND q is the meet (greatest lower bound) of p and q, and p OR q is the join (least upper bound) of p and q. So for example,
The Hasse diagram in the article makes sure that expressions like this agree with our intuition in the cases where we have intuition for what the result should be, and give us a way to interpret expressions consistently when our intuitions fail us.
We're used to seeing Hasse diagrams for subsets of a set S used to indicate inclusion, in which case you would have {} < {F}, but you can have a valid poset structure that's not based on inclusion.