开发者

Overloaded functions in modules

开发者 https://www.devze.com 2022-12-30 09:13 出处:网络
Since curried functions cannot 开发者_开发问答be overloaded and modules cannot have members, does this mean there is no way to have an overloaded function in a module? The answer seems obvious, but I

Since curried functions cannot 开发者_开发问答be overloaded and modules cannot have members, does this mean there is no way to have an overloaded function in a module? The answer seems obvious, but I want to make sure there's not something I'm overlooking.


Correct, no overloaded functions in modules (more generally, no way to overload a let-bound function). If you say f, then f always has a single type, whereas if you say o.f, that may refer to a group of overloads (resolved by surrounding context).

0

精彩评论

暂无评论...
验证码 换一张
取 消