Yeah I am not a huge fan of the compiler code in SML for the ones I've looked at (though I haven't looked at them all). Often it's just one author so they often omit types on nested functions (since they're optional for the compiler) so they're nearly impossible for me to read without spending a huge amount of time on it.
Going off on a tangent, I think every language should require function parameters and return types to be explicitly typed. If that gets rid of the bulk of HM type inference that's cool. The only value to me of type inference is at the local variable level. Function type inference makes code impossible to read.
> Function type inference makes code impossible to read.
And the type errors very non-local and therefore hard to understand. The reason is that HM type inference infers types not only in the leaves->roots direction, but also roots->leaves. An expression gets assigned a type based on the context it appears in. It works wonderfully when the program type checks, because e.g. it allows one to write something like "let x = None" in Rust instead of "let x: Option<very long type name> = Option<very long type name>::None;" as long as further uses of x (such as returning it as the value of the enclosing function) clarify its type. However, when a program is during development, you change things here and there, when one variable binding (such as a function definition), which wasn't explicitly typed, appears in at least two places which require this variable to have conflicting types, then almost certainly the error is going to be generated for a line that you as a human see completely disconnected from where the error actually is. Maybe it's in the function definition, maybe it's in one of its uses. And those things can be further obscured by several indirections of intermediate functions with successfully inferred types.
And also WebML [2], SOSML [3], Bright-ML [4] (had to refresh my memory from my 2020 post on the topic [5]).
[0] http://blog.hydromatic.net/2020/02/25/morel-a-functional-lan...
[1] https://github.com/hydromatic/morel
[2] https://github.com/KeenS/webml
[3] https://github.com/SOSML/SOSML
[4] https://github.com/elpinal/bright-ml
[5] https://notes.eatonphil.com/standard-ml-in-2020.html