4 ms·
I don't understand how they don't compose, from your example: (X = A + B, Y = X + C, Y = A + B + C is false) I understand that types aren't math values, b
by nikajon_es 2y ago
I don't understand how they don't compose, from your example:
(X = A + B, Y = X + C, Y = A + B + C is false)
I understand that types aren't math values, but isn't the point of using a `+` to describe the communicative value of the type so that `(A + B) + C = A + B + C`?
Also
- marcosdumay 2y agodata A = A data B = B data X = XA A | XB B data Y = YA A | YB B f :: X -> () f = undefined let r = f (undefined :: Y) There's absolutely no way to write this so it compiles. In fact, there isn't even a way to define the composed types so that they only express a sum, you have to add extra baggage.