TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Scala Tutorials Part #2 – Type Inference and Types in Scala – Madusudanan

22 点作者 madhusudhan000超过 9 年前

1 comment

nv-vn超过 9 年前
This article kind of ignored the difference between local and global type inference when grouping languages with inferred types into a list, even though the concepts are entirely different (both in implementation details and in the way they affect use of the language). For example, having local type inference makes it impossible to share a syntax between functions and variables, plus the process of 'inferring' these types simply involves looking up the type of the expression by looking at the functions/values/operators used (which already have a known type at that point). With global type inference, looking at a term alone will not give you all the information that you need because there's no annotated information about what the types of arguments to your function will be. The difference means that local type inference is just taking information from the right side and placing it on the left, while global inference is a recursive process of unifying information that is not necessarily connected in a clear way.
评论 #10771034 未加载