Weak type variables are instantiated w.r.t the environment at the time of their introduction (?)

Yes, I know the distinction between polymorphic and weak variables. But I had never linked the value of weak variables to their environment… and, as I wrote, tutorials and manuals usually gloss over this as they stick to types from the prelude.

That makes sense.

Concerning the “scope escape” message, this is indeed quite cryptic… Beyond the question of whether it should be removed, and/or whether it should be defined in the manual, the main question for me is rather whether it’s possible to get clearer/more detailed messages in at least some situations where this error happens.

On a related note, the error message story in OCaml is far better than before (I started using Caml in 1997) but I really wish they were even better. I know @charguer had worked on that (and there’s also this work on [ANN] harmatia, "prettified" compiler error message plugin - #3 by paurkedal)… Some messages are really hard to explain to students, and even for teachers that don’t know what a scope escape is :slight_smile: , and the thing is that some of these messages sometimes happen even when not using advanced type features.