【摘要】Product type guarantees that if you have a function of type Y -> X1 and a function of type Y -> X2, you must have a unique function of type Y -> X1 x X2 satisfying the property. Sum type guarantees that if you have a unique function of type X1 -> Y and a function of type X2 -> Y, you must have a function of type X1 ∐ X2 -> Y satisfying the property.
阅读全文