Comment by BoppreH

Comment by BoppreH 11 hours ago

1 reply

I hear that OCaml without interface files can cause spooky-action-at-a-distance type errors[1]. Have you had experience with that?

> But in practice it's quite handy to annotate module interfaces and even individual functions.

Yes, but it also limits what information the types can represent because of syntax and human patience limitations. A fully inferred language could associate numbers with possible value ranges, lists with their sizes, enumeration of fixed string values, etc.

[1] https://news.ycombinator.com/item?id=39615796

dwattttt 5 hours ago

> spooky-action-at-a-distance type errors

Global type inference is literally this. Inferring types leaves gaps in the typing information, being global means the gaps can be arbitrarily large, and so a type conflict could theoretically span every line of a large program.