V2EX  ›  英汉词典

Contravariance

定义 Definition

contravariance(逆变):在数学(尤其是范畴论)与编程语言类型系统中,指一种“方向相反”的变化规律——当输入发生变化时,相关映射/类型参数的方向与通常的“协变”相反(常见于函数参数类型、反变函子等)。也可泛指“反向依赖/反向变动关系”。

例句 Examples

In type systems, function parameter types can show contravariance.
在类型系统中,函数的参数类型可能表现出逆变。

Contravariance explains why a function that accepts a more general input type can be used where a more specific one is expected, under certain typing rules.
逆变解释了为什么在某些类型规则下,能接收更一般输入类型的函数,可以用在原本期望更具体输入类型的地方。

发音 Pronunciation (IPA)

/ˌkɒntrəˈveəriəns/(英式常见)
/ˌkɑːntrəˈveriəns/(美式常见)

词源 Etymology

来自 **contra-**(拉丁语前缀,意为“相反、对立”)+ variance(变化、变动)。字面含义就是“相反方向的变化”,后来在数学与类型理论中被用作专门术语。

相关词 Related Words

文学与经典作品 Literary Works

  • Categories for the Working Mathematician(Saunders Mac Lane)
  • Basic Category Theory(Tom Leinster)
  • Types and Programming Languages(Benjamin C. Pierce)
  • Practical Foundations for Programming Languages(Robert Harper)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   725 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 21:04 · PVG 05:04 · LAX 13:04 · JFK 16:04
♥ Do have faith in what you're doing.