根据Curry-Howard 对应,sum-type aka tagged-union 相当于析取,逻辑 OR
为什么会这样?不是更接近异或吗?(a or b)
意味着它可以是a
orb
或both
,而Either a b
必须是a
orb
但绝不是两者。
根据Curry-Howard 对应,sum-type aka tagged-union 相当于析取,逻辑 OR
为什么会这样?不是更接近异或吗?(a or b)
意味着它可以是a
orb
或both
,而Either a b
必须是a
orb
但绝不是两者。