let module は expansive ?

# let id =
    let module M = struct end in
    fun x -> x
val id : '_a -> '_a = <fun>


Caml mantis でも、

What you propose is changing the value restriction to accept a local
module binding. Before we do that, we'll need to come up with a proof
that such a change is sound. Intuitively, I don't believe it's the




let id = let v = ref [] in fun x -> v := [x]; x

が polymorphic にならないのと同じ理由だ:

(* 明らかにまずい例 *)
let id = 
  let module M = struct let v = ref [] end in
  fun x -> M.v := [x]; x

しかし、 Local module の定義を調べて全部 non-expansive なら絶対 ok だと思うんだが、どでしょう。現在の OCaml はそこまで調べずに即、expansive という扱い。