Well, to put it another way, we need to solve the equation, x with B = A with B for x. We want the solution to be x = A, but x = A with B is also a solution...
-
-
Replying to @propensive @guizmaii
You would just need to normalize the type before applying the Negation, it doesn't seem like an insurmountable problem to me at all
1 reply 0 retweets 0 likes -
Replying to @LukaJacobowitz @guizmaii
I think you're misreading... there are literally two distinct solutions for x in that example, regardless of whether you normalize (plus potentially others). This could work if type intersections formed a free monoid, but it's not free...
2 replies 0 retweets 0 likes -
Replying to @propensive @guizmaii
We can use the same example with set intersection: x ∩ B = A ∩ B Yes, x could be both A or (A ∩ B) or (A ∩ A ∩ B ∩ B ∩ B), that doesn't mean that (A ∩ B) \ B = A. It is NOT subtraction, but difference or negation. I.e. the difference between a Group and a Boolean algebra
1 reply 0 retweets 1 like -
Replying to @LukaJacobowitz @guizmaii
Ok, but what should (A ∩ B) \ B give if A = C ∩ B? A might be abstract. Here's a concrete example with types. What is, (Some[Int] with Product) \ Product ?
1 reply 0 retweets 0 likes -
Replying to @propensive @guizmaii
I think that would just be Some[Int] \ Product (maybe the scala compiler can prove this is Nothing, but it's not a deal breaker either way)
1 reply 0 retweets 0 likes -
-
Some[Int] is a Product, so if you forbid Product then nothing can satisfy Some[Int] right?
2 replies 0 retweets 1 like -
I concur, it's kinda how you can have `Int & String` it's also equivalent to `Nothing`, but the compiler can't necessarily check that
2 replies 0 retweets 0 likes -
Int & String is not equivalent to Nothing at all! They happen to have the same members, but they're very different types. Types are defined by their properties, and Int & String represents the union of the sets of properties of Int and String...
2 replies 0 retweets 0 likes
Whereas Nothing is the union of all properties of all types, which is the equivalent to the intersection of all types. It's a subtype of everything, which makes it the most constrained, most specific type.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.