In Scala, is it possible to "subtract" a type from a composed type like this one: "A with B with C" ?

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...
-
-
Maybe I am misreading, I don't understand how multiple solutions are a problem here. I also don't understand what you mean by free monoid in this context.
-
Is it possible you aren't agreeing on what "subtract" means?
- Show replies
New conversation -
-
-
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
-
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 ?
- Show replies
New conversation -
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.