3 ms·
> the changes ripple through the program creating confusing errors sometimes where the compiler is trying to knit things together. F# is derived from OCaml, an
by yawaramin 2y ago
> the changes ripple through the program creating confusing errors sometimes where the compiler is trying to knit things together.
F# is derived from OCaml, and they both support interface files–in the case of F#, with the .fsi extension–which is designed to solve exactly this problem. After settling on the surface area of your module, you nail it down by writing an interface file with the exact types you want to enforce. The compiler then uses this to check the usage of the module by its consumers, and provides much more accurate type errors.
It works really well.