类型系统中的反例 (2021)
摘要
一个精心收集的反例合集,展示了类型系统的局限性和陷阱,作为程序员和语言设计者的教育资源。
暂无内容
查看缓存全文
缓存时间: 2026/06/30 21:39
# 类型系统中的反例 - 类型系统中的反例
来源:https://counterexamples.org/
1. 类型系统中的反例 (https://counterexamples.org/title.html)
2. 引言 (https://counterexamples.org/intro.html)
3. 索引与词汇表 (https://counterexamples.org/glossary.html)
4. **1\.**多态引用 (https://counterexamples.org/polymorphic-references.html)
5. **2\.**协变容器 (https://counterexamples.org/general-covariance.html)
6. **3\.**不完全的变体检查 (https://counterexamples.org/incomplete-variance.html)
7. **4\.**构造中的对象 (https://counterexamples.org/under-construction.html)
8. **5\.**柯里悖论 (https://counterexamples.org/currys-paradox.html)
9. **6\.**最终,虚无 (https://counterexamples.org/eventually-nothing.html)
10. **7\.**可疑的证据 (https://counterexamples.org/dubious-evidence.html)
11. **8\.**某种类型的“任意值” (https://counterexamples.org/anythings.html)
12. **9\.**任意(单个)事物 (https://counterexamples.org/anything-once.html)
13. **10\.**可变匹配 (https://counterexamples.org/mutable-matching.html)
14. **11\.**运行时类型信息误导 (https://counterexamples.org/runtime-misinformation.html)
15. **12\.**重载与多态 (https://counterexamples.org/overloading-polymorphism.html)
16. **13\.**区别性 I:单射性 (https://counterexamples.org/distinctness-injectivity.html)
17. **14\.**区别性 II:递归 (https://counterexamples.org/distinctness-recursion.html)
18. **15\.**区别性 III:选项 (https://counterexamples.org/distinctness-options.html)
19. **16\.**子类型与继承 (https://counterexamples.org/subtyping-vs-inheritance.html)
20. **17\.**自私性 (https://counterexamples.org/selfishness.html)
21. **18\.**隐私侵犯 (https://counterexamples.org/privacy-violation.html)
22. **19\.**不稳定的类型表达式 (https://counterexamples.org/unstable-types.html)
23. **20\.**回避问题 (https://counterexamples.org/avoidance.html)
24. **21\.**知其一隅... (https://counterexamples.org/little-knowledge.html)
25. **22\.**欠确定的递归 (https://counterexamples.org/underdetermined-recursion.html)
26. **23\.**过确定的递归 (https://counterexamples.org/overdetermined-recursion.html)
27. **24\.**作用域逃逸 (https://counterexamples.org/scope-escape.html)
28. **25\.**虚假伪装 (https://counterexamples.org/false-pretenses.html)
29. **26\.**可疑的子项 (https://counterexamples.org/suspicious-subterms.html)
30. **27\.**只有一个莱布尼茨 (https://counterexamples.org/only-one-leibniz.html)
31. **28\.**交叉引用 (https://counterexamples.org/intersecting-references.html)
32. **29\.**多态联合细化 (https://counterexamples.org/polymorphic-union-refinement.html)
33. **30\.**严格与非严格的正性 (https://counterexamples.org/strict-positivity.html)
34. **31\.**近乎全称量化 (https://counterexamples.org/nearly-universal.html)
## 类型系统中的反例
https://counterexamples.org/print.htmlhttps://github.com/stedolan/counterexamples
## 类型系统中的反例 (https://counterexamples.org/#counterexamples-in-type-systems)
*由 Stephen Dolan 整理,感谢 Andrej Bauer、Leo White 和 Jeremy Yallop*
https://counterexamples.org/intro.html
https://counterexamples.org/intro.html
相似文章
揭秘类型(及一些悖论的解惑)
类型理论为编程语言基础增加了不必要的复杂性,并提出基于关系成员的更简单观点。
新Blub悖论,或者说:为什么TypeScript在AI时代是一个糟糕的选择
认为TypeScript由于不健全的类型系统而成为AI时代的一个糟糕默认选项,它无法捕获AI生成的代码中的错误,并将其比作Paul Graham的Blub悖论。
擦除存在类型
深入探讨 Rust 类型系统中的存在量词,比较 `dyn Trait` 和 `impl Trait`,并探索超越 `Self` 的存在量化类型变量的高级模式。
静态类型与铲子(2026)
作者认为,2010年代静态类型编程的复兴归功于改进的类型系统(例如 TypeScript、Haskell、Rust),这些系统提供了可空类型处理、和类型以及类型推断,与 Java 和 C++98 等早期语言中糟糕的静态类型形成对比。
不仅仅是组合数学与反例:GPT-5.5 解决纯泛函分析中的精选问题
本文展示了 GPT-5.5 解决纯泛函分析中精选问题的能力,超越了典型的组合数学与反例任务。