开发者

Overloaded functions in modules

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜