ocaml dom类型的js_前面的#字符的含义

ocaml dom类型的js_前面的#字符的含义,ocaml,js-of-ocaml,Ocaml,Js Of Ocaml,以下签名中的“#”是什么意思 val insertBefore : #node Js.t -> #node Js.t -> #node Js.t Js.opt -> unit 请参阅OCaml参考手册()的#-types部分 函数类型#node->t获取类node或其子类的对象并返回t 比如说, class c = object method x = 1 end let g : #c -> int = fun o -> o#x 函数g可以接受类c或其子类的对象

以下签名中的“#”是什么意思

val insertBefore : #node Js.t -> #node Js.t -> #node Js.t Js.opt -> unit
请参阅OCaml参考手册()的
#-types
部分

函数类型
#node->t
获取类
node
或其子类的对象并返回
t

比如说,

class c = object method x = 1 end

let g : #c -> int = fun o -> o#x
函数
g
可以接受类
c
或其子类的对象
#c
因此

let h = (g : < x : int; ..> -> int)
设h=(g:->int)
已检查类型。

请参阅OCaml参考手册()的
#-types
部分

函数类型
#node->t
获取类
node
或其子类的对象并返回
t

比如说,

class c = object method x = 1 end

let g : #c -> int = fun o -> o#x
函数
g
可以接受类
c
或其子类的对象
#c
因此

let h = (g : < x : int; ..> -> int)
设h=(g:->int)
是否进行了类型检查